Git add and commit in one command

后端 未结 27 2456
旧巷少年郎
旧巷少年郎 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:34

    In the later version of git you can add and commit like this

    git commit -a -m "commit message"
    

    Additionally you an alias:

    [alias]
        ac = commit -a -m
    

    Then you can use it like this:

    git ac "commit message"
    

提交回复
热议问题