git commit -m vs. git commit -am

后端 未结 2 680
不思量自难忘°
不思量自难忘° 2021-01-30 01:43

Seems easy but I just don\'t get it. I am in the root of my application.

Here is my workflow.

git add .
git commit -m \"added a new feature some files ch         


        
2条回答
  •  感情败类
    2021-01-30 01:54

    From the docs:

    git commit -a automatically stage all tracked, modified files before the commit If you think the git add stage of the workflow is too cumbersome, Git allows you to skip that part with the -a option. This basically tells Git to run git add on any file that is "tracked" - that is, any file that was in your last commit and has been modified. This allows you to do a more Subversion style workflow if you want, simply editing files and then running git commit -a when you want to snapshot everything that has been changed. You still need to run git add to start tracking new files, though, just like Subversion.

    Using the option -am allows you to add and create a message for the commit in one command.

提交回复
热议问题