Git add and commit in one command

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

    I hope this helps someone and please feel free to edit or improve. I'm not sure what the fastest way is but this certainly simplifies my code commit process by using "ohmyzsh" for Git.

    https://ohmyz.sh/

    • git add . is shortened to ga .
    • git commit -m "message" is shortened to gc -m "message"
    • git push is shortened to gp
    • git fetch is shortened to gf
    • git pull origin master is shortened to ggl master
    • git push origin master is shortened to ggp master
    • git checkout -b is shortened to gcb
    • git merge is shortened to gm
    • git remote is shortened to gr
    • git status is shortened to gst

提交回复
热议问题