撰写提交邮件时,git -m "message"
和git commit -am "message"
一直在听一个教程而且这个家伙没有清楚地解释两者之间的区别
答案 0 :(得分:1)
-a
标志会将所有当前跟踪的文件添加到提交中。它不会添加新文件。它与消息无关。
来自man page:
-a
--all
Tell the command to automatically stage files that have been modified and
deleted, but new files you have not told git about are not affected.
答案 1 :(得分:1)
通常你会做
//tell git to stage all the files
git add .
//now commit all the staged files with this message
git commit -m "message"
//Assuming you have just modified existing files in git repo.. you could use this as a shortcut
git commit -am "message"
//meaning, stage all the modified files and commit with this message.
答案 2 :(得分:1)
git -m message
添加了当前添加的文件和给定消息的提交,而git -am message
添加了所有跟踪的文件,然后提交当前消息。