“git add”和“git update-index”有什么区别?
在什么情况下我会使用这些命令中的一个或另一个?
最佳答案
基本上,update-index
是一个plumbing 命令——意思是,低级别。 git add
内部使用 update-index
.我相信,那
git add <file>
与git update-index --add <file>
相同
其中一种情况,当我使用 update-index 时,您对文件进行了更改,但您不想提交 - 在这种情况下,您可以运行
git update-index --assume-unchanged <file>
所以如果你运行 git status
之后,您会看到该文件不在已更改文件列表中。
更多信息 How to manage configuration files when collaborating?
这里http://gitready.com/intermediate/2009/02/18/temporarily-ignoring-files.html
关于git - "git add"和 "git update-index"有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38585812/