How to make 'git diff' ignore comments

前端 未结 6 1476
闹比i
闹比i 2020-12-05 02:38

I am trying to produce a list of the files that were changed in a specific commit. The problem is, that every file has the version number in a comment at the top of the file

6条回答
  •  攒了一身酷
    2020-12-05 02:57

    I found a solution. I can use this command:

    git diff --numstat --minimal   | sed '/^[1-]\s\+[1-]\s\+.*/d'
    

    To show the files that have more than one line changed between commits, which eliminates files whose only change was the version number in the comments.

提交回复
热议问题