Git add and commit in one command

后端 未结 27 2427
旧巷少年郎
旧巷少年郎 2020-11-28 00:28

Is there any way I can do

git add -A
git commit -m \"commit message\"

in one command?

I seem to be doing those two commands a lot,

27条回答
  •  甜味超标
    2020-11-28 00:50

    I use the following alias for add all and commit:

    git config --global alias.ac '!git add -A && git commit -a'
    

    Then, by typing:

    git ac
    

    I get a vim window to get more editing tools for my commit message.

提交回复
热议问题