Skip to content

Instantly share code, notes, and snippets.

@husa
Last active February 18, 2016 12:44
Show Gist options
  • Save husa/96840df37b2bb4a96de4 to your computer and use it in GitHub Desktop.
Save husa/96840df37b2bb4a96de4 to your computer and use it in GitHub Desktop.
Usefull git aliases
[alias]
pr = pull --rebase origin
po = push origin
poH = pugh origin HEAD
co = checkout
st = status --short
f = fetch
fa = fetch --all
k = !gitk
ka = !gitk --all
history = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --abbrev-commit --date=short --max-count=20
unstage = reset HEAD
undo = "!f() { echo 'Are you sure you want to revert your last commit?(y/n)'; read answer; case \"$answer\" in y) git reset --soft HEAD^ && echo done;; n) echo 'as you wish';; *) f;; esac; }; f";
aliases = "!git config -l | grep alias | cut -c 7- | tr '=' '\t\t'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment