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

后端 未结 5 1693
挽巷
挽巷 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:12

    I suggest another solution: using git commit --interactive -m "your commit message" will show you this menu

    *** Commands ***
      1: [s]tatus     2: [u]pdate     3: [r]evert     4: [a]dd untracked
      5: [p]atch      6: [d]iff   7: [q]uit   8: [h]elp
    

    allowing you to check status, add untracked files and so on using simple keystrokes.

提交回复
热议问题