Want to exclude file from “git diff”

后端 未结 13 1918
梦谈多话
梦谈多话 2020-12-07 07:27

I am trying to exclude a file (db/irrelevant.php) from a Git diff. I have tried putting a file in the db subdirectory called .gitattributes

13条回答
  •  执笔经年
    2020-12-07 07:41

    You can also use filterdiff program of the patchutils program collection to exclude some parts of a diff. For example:

    git diff | filterdiff -p 1 -x db/irrelevant.php
    

提交回复
热议问题