Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一些文件
1、2、3、4、5、6、7、8、9、10
我只想提交文件 1-5,所以我添加了文件 1-5
要提交的更改: (使用“git reset HEAD ...”取消暂存) 1、2、3、4、5
要提交的更改:
(使用“git reset HEAD ...”取消暂存)
1、2、3、4、5
并将文件 6-10 留在更改“未暂存以进行提交”列表中。
但是,当我想提交使用
git 提交 -a
我也看到那些文件 6-10
要提交的更改: (使用“git reset HEAD ...”取消暂存)
我认为当我手动添加文件 1-5 时,文件 6-10 也不会添加到“要提交的更改”列表中,对吧?
git commit -a
添加文件以及提交。它相当于:
git add -u . git commit
从手册页:
OPTIONS -a, --all 告诉命令自动暂存已修改和删除的文件,但您没有告诉 git 的新文件不受影响。
你只想:
git commit
仅提交已暂存的文件。