[英]what is the difference between ~/.gitignore and `git update-index --assume-unchanged`
[英]What is the difference between “git add” and “git update-index”
“ git add”和“ git update-index”有什么区别?
在什么情况下我会使用其中一个命令?
引用git help update-index
:
另请参阅git-add(1)以获得更友好的方式来对索引执行一些最常见的操作。
因此, git add
是您通常使用的东西,而git update-index
是更强大的变体,它也需要您更多的知识。
NB。 习惯git help
命令真的很值得, git help
的帮助页面非常出色 。
基本上, update-index
是一个管道命令-这意味着它是低级的。 git add
内部使用update-index
。 我相信
git add <file>
与git update-index --add <file>
在我使用update-index的情况下,一种情况是您更改了不想提交的文件-在这种情况下,您可以运行
git update-index --assume-unchanged <file>
因此,如果在此之后运行git status
,则会看到该文件不在更改的文件列表中。
更多信息协作时如何管理配置文件?
和这里http://gitready.com/intermediate/2009/02/18/temporarily-ignoring-files.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.