Why doesn't git commit -a add new files?

后端 未结 5 1696
挽巷
挽巷 2020-12-29 19:55

I\'m a bit new to git, and I fail to understand why git commit -a only stages changed and deleted files but not new files.

Can anyone explain why is it

5条回答
  •  既然无缘
    2020-12-29 20:18

    Kelly is correct but I think another factor is that so many people expect that behavior because CVS, Subversion, and most other tools do it that way.

    If Git committed new files, you might notice that you had committed .o files long ago and even worse they might harm the build.

提交回复
热议问题