Some useful Git aliases I use every day

Friday, 24 June 2016

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>

  • a = add .

git config --global alias.a "add ."

  • alias = ! 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/\ /\ =\ /"

  • arane = commit --amend --reset-author --no-edit

git config --global alias.arane "commit --amend --reset-author --no-edit"

  • ca = commit --amend

git config --global alias.ca "commit --amend"

  • cane = commit --amend --no-edit

git config --global alias.cane "commit --amend --no-edit"

  • cc = checkout

git config --global alias.cc "checkout"

  • ck = checkout

git config --global alias.ck "checkout"

  • ckd = checkout dev

git config --global alias.ckd "checkout dev"

  • ckm = checkout master

git config --global alias.ckm "checkout master"

  • cm = commit -m

git config --global alias.cm "commit -m"

  • co = commit

git config --global alias.co "commit"

  • cp = cherry-pick

git config --global alias.cp "cherry-pick"

  • csa = commit -S --amend

git config --global alias.csa "commit -S --amend"

  • csane = commit -S --amend --no-edit

git config --global alias.csane "commit -S --amend --no-edit"

  • csm = commit -S -m

git config --global alias.csm "commit -S -m"

  • dom = diff --stat origin/master

git config --global alias.dom "diff --stat origin/master"

  • ft = fetch --tags

git fetch --tags

  • fod = fetch origin mdev:dev

git config --global alias.fod "fetch origin dev:dev"

  • fom = fetch origin master:master

git config --global alias.fom "fetch origin master:master"

  • fu = 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"

  • logi = log --pretty=oneline

git config --global alias.logi "log --pretty=oneline"

  • md = merge dev

git config --global alias.md "merge dev"

  • mm = merge master

git config --global alias.mm "merge master"

  • pod = push origin dev

git config --global alias.pod "push origin dev"

  • pfo = push -f origin

git config --global alias.pfo "push -f origin"

  • pfod = push -f origin dev

git config --global alias.pfom "push -f origin dev"

  • pfom = push -f origin master

git config --global alias.pfom "push -f origin master"

  • po = push origin

git config --global alias.po "push origin"

  • pom = push origin master

git config --global alias.pom "push origin master"

  • pomt = push origin master --tags

git push origin master --tags

  • puo = pull origin

git config --global alias.puo "pull origin"

  • puom = pull origin master

git config --global alias.puom "pull origin master"

  • rao = remote add origin

git config --global alias.rao "remote add origin"

Swift Link Preview »