Is it possible to skip the staging area and (also) commit untracked, new files to git?

后端 未结 4 1240
情深已故
情深已故 2020-12-15 08:57

Is it possible to skip the staging area and (also) commit untracked, new files to git in a single built-in, command-line command ? If not,

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 09:20

    Using a single, built-in, command-line command? No.

    Using two commands:

    git add -A
    git commit
    

    Using a custom alias:

    Add this to .gitconfig:

    [alias]
       commituntracked = "!git add -A; git commit"
    

    Then you can do

    git commituntracked
    

提交回复
热议问题