How to make git-diff and git log ignore new and deleted files?

后端 未结 3 1810
花落未央
花落未央 2021-01-30 01:19

Sometimes there\'s a couple of changed files together with some new, deleted and/or renamed files. When doing git diff or git-log I\'d like to omit the

3条回答
  •  一向
    一向 (楼主)
    2021-01-30 01:46

    The --diff-filter option works with both diff and log.

    I use --diff-filter=M a lot which restricts diff outputs to only content modifications.

    To detect renames and copies and use these in the diff output, you can use -M and -C respectively, together with the R and C options to --diff-filter.

提交回复
热议问题