为什么要先 git add 才能 git commit

2025-05-06 21:57:39
推荐回答(1个)
回答1:

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