Some Useful Git Aliases I Use Every Day
Some useful Git aliases I use every day that can help you optimize your time.
Add them with git config --global alias.<your shortcut> <git command>
add .
git config --global alias.a "add ."
! git config --get-regexp ^alias\. | sed -e s/^alias\.// -e s/\ /\ =\ /
git config --global alias.alias "! git config --get-regexp ^alias\. | sed -e s/^alias\.// -e s/\ /\ =\ /"
commit --amend --reset-author --no-edit
git config --global alias.arane "commit --amend --reset-author --no-edit"
commit --amend
git config --global alias.ca "commit --amend"
commit --amend --no-edit
git config --global alias.cane "commit --amend --no-edit"
checkout
git config --global alias.cc "checkout"
checkout
git config --global alias.ck "checkout"
checkout dev
git config --global alias.ckd "checkout dev"
checkout master
git config --global alias.ckm "checkout master"
commit -m
git config --global alias.cm "commit -m"
commit
git config --global alias.co "commit"
cherry-pick
git config --global alias.cp "cherry-pick"
commit -S --amend
git config --global alias.csa "commit -S --amend"
commit -S --amend --no-edit
git config --global alias.csane "commit -S --amend --no-edit"
commit -S -m
git config --global alias.csm "commit -S -m"
diff --stat origin/master
git config --global alias.dom "diff --stat origin/master"
fetch --tags
git fetch --tags
fetch origin mdev:dev
git config --global alias.fod "fetch origin dev:dev"
fetch origin master:master
git config --global alias.fom "fetch origin master:master"
add . && git commit --amend --no-edit && git push -f origin master
git config --global alias.fu "add . && git commit --amend --no-edit && git push -f origin master"
log --pretty=oneline
git config --global alias.logi "log --pretty=oneline"
merge dev
git config --global alias.md "merge dev"
merge master
git config --global alias.mm "merge master"
push origin dev
git config --global alias.pod "push origin dev"
push -f origin
git config --global alias.pfo "push -f origin"
push -f origin dev
git config --global alias.pfom "push -f origin dev"
push -f origin master
git config --global alias.pfom "push -f origin master"
push origin
git config --global alias.po "push origin"
push origin master
git config --global alias.pom "push origin master"
push origin master --tags
git push origin master --tags
pull origin
git config --global alias.puo "pull origin"
pull origin master
git config --global alias.puom "pull origin master"
remote add origin
git config --global alias.rao "remote add origin"