Commit and automatically add all untracked files

后端 未结 5 1888
南方客
南方客 2020-12-23 09:07

I often forgot that I have some new files and directly do,

git commit -a -m \"My commit message\"

This only commits changed files, and I ha

5条回答
  •  情书的邮戳
    2020-12-23 09:45

    You can define an alias to add all before commit. Just put this lines into your ~/.gitconfig file :

    [alias]
            ca = !sh -c 'git add -A && git commit -m \"$1\"' -
    

    Then use your alias like this :

    $ git ca 'Your commit message'
    

提交回复
热议问题