显示git diff,忽略文件权限更改? [英] Show git diff, ignoring file permission changes?
问题描述
我在实时服务器上运行了几个 chmod
。现在,当我在那里执行 git diff
时,我看到很多旧模式100644新模式100755
I have run several chmod
in my live server. Right now when I do a git diff
there, I see lots of old mode 100644 new mode 100755
我还在那里更改了一些文件。但是我只需要git diff来显示文件上的更改,而忽略文件权限的更改。
I have also changed some files there. But I would just git diff just to show the changes on the files, ignoring the file permissions changes.
我该怎么做?顺便说一句,我不想让GIT忽略那些文件权限的更改。其实我想提交它们,我只是想让git diff在特定的时刻不显示它们。
How can I do that? BTW, I don't want GIT to ignore those file permissions changes. Actually I want to commit them, I just want git diff to not show them for a very specific moment.
推荐答案
git忽略权限:
git config core.filemode false
过滤掉 diff
的结果,但不要忽略它们
to filter them in result of diff
but not ignore them
git filter-branch -f --tree-filter 'find * -type f | xargs chmod 644 ' -- --all
这篇关于显示git diff,忽略文件权限更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!