3 回答

TA贡献1895条经验 获得超7个赞
When files are given on the command line, the command commits the contents of the named files, without recording the changes already staged. The contents of these files are also staged for the next commit on top of what have been staged before.
你的理解是正确的,最后携带文件参数将会直接提交这些文件当前的内容而不是缓冲区中的更改。

TA贡献1752条经验 获得超4个赞
这样提交不上去的啊!执行完git commit -m '提交日志'
,肯定要执行一下git push origin 分支
才能更新到对应的远程分支。git commit -m '提交日志'
后面加修改的文件没用啊

TA贡献2011条经验 获得超2个赞
没错,git commit -m 'xxx'只会提交git add过文件到暂存区的更新,而且批量的,就是所有在暂存区里的文件都会被提交
git commit -m 'xxx' a.php,指定了文件可以不用git add也可以提交,但是只能一个,如果要多个文件,必须要一个一个完整文件名追加在命令后面
所以如果我要提交所有修改过的文件,但是没有git add到暂存区,我会用这个命令git commit -am 'x'
- 3 回答
- 0 关注
- 919 浏览
添加回答
举报