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 關注
- 910 瀏覽
添加回答
舉報