git 修改文件權限引起的修改

今天在git提交代碼的時候,並無對修改文件,可是提示我更新。我使用git diff查看了一下:python

[root@localhost doc]# git diff python/en/whatsnew/index.rst 
diff --git a/python/en/whatsnew/index.rst b/python/en/whatsnew/index.rst
old mode 100644
new mode 100755

發現文件是由於權限的改變而致使我須要提交文件。感受這種東西特別麻煩。對我來講不須要。不知要git爲何要把這個文件權限也放到了版本管理中。很奇怪。
可是老是會有辦法的,
咱們能夠使用以下方法讓git忽略文件權限,執行如下命令git

git config core.filemode false

而後咱們再次查看的時候。就沒有問題了。shell

相關文章
相關標籤/搜索