git 暂存区的意义是什么?
1.git 的 add ,是一个容易引起疑问的命令。在 subversion 中的 svn add
动作是将某个文件加入版本控制,而 git add的意义完全不同。
同时, git diff --cached
是比较 stage 的文件的差异的,也是一个不直观的命令。
github 2008年的blog中,也提到,容易引起混淆:
https://github.com/blog/196-gittogether-2008
http://learn.github.com/p/normal.html
things like making use of the term ‘stage’ for things that happen in the index (such as using ‘git diff —staged’ instead of ‘git diff —cached’) is being worked on. I’m excited that staging files may soon be done via ‘git stage’ rather-than/in-addition-to ‘git add’. This is nice for new users who often have a hard time seeing why you have to keep ‘git add’ing to stage your changes.