git显示文件更改为0插入(+),0删除(-) [英] git shows files changed with 0 insertions(+), 0 deletions(-)
本文介绍了git显示文件更改为0插入(+),0删除(-)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
很多时候我运行"git diff --shortstat"命令并输出以下内容:
There are many times when I run a "git diff --shortstat" command and it outputs the following:
17 files changed, 0 insertions(+), 0 deletions(-)
即使没有插入或删除操作,文件怎么可能更改?
Hows that possible that files changed even though there were no insertions or deletions?
推荐答案
如果项目中某些文件的文件权限已更改,则可以这样做:
This is possible if the file permissions have changed for some of the files in the project:
示例:
$ git init && touch file && git add file && git commit -m "msg"
Initialized empty Git repository in /home/user/Desktop/test/.git/
$ chmod +x file
$ git diff --shortstat
1 file changed, 0 insertions(+), 0 deletions(-)
您可以使用git config core.filemode false
关闭此功能.
You can use git config core.filemode false
to turn this feature off.
这篇关于git显示文件更改为0插入(+),0删除(-)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文