Skip to content

Instantly share code, notes, and snippets.

@kissgyorgy
Last active December 26, 2015 14:49
Show Gist options
  • Save kissgyorgy/7168114 to your computer and use it in GitHub Desktop.
Save kissgyorgy/7168114 to your computer and use it in GitHub Desktop.
Git: useful aliases
[core]
pager = less -F -X
[alias]
a = add
# status short format, only show changed files.
s = status -sb
ss = status
d = diff
# show staged changes only
dc = diff --cached
t = tag
b = branch
co = checkout
cm = commit -v
ame = commit --amend
sta = stash
pu = push
la = log -1 --stat HEAD
lap = !git la -p
# nicely formatted log since master (not merged commits since master)
l = log --color --graph --pretty=format:'%C(yellow)%h%Creset -%C(blue)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit master..
# Doesn't leave output on window when quit from pager
lg = !GIT_PAGER=less git log --color --graph --pretty=format:'%C(yellow)%h%Creset -%C(blue)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lg2 = !GIT_PAGER=less git log --pretty=format:'%C(yellow)%h %C(blue)%ad%C(red)%d %C(reset)%s%C(green) [%cn]' --decorate --date=short
conf = config
gconf = config --global
# edit global config
econf = config --global -e
# list global config
lconf = config --global -l
res = reset HEAD --
undo = reset --soft HEAD^
# show latest commits on every branch and every tag
latest = for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short) [%(committername)]'
# what did I do since yesterday in short format
what = log --since '1 day ago' --oneline --author Walkman
# what did I do since yesterday, shows changed files
whatsup = log --since '1 day ago' --author Walkman --stat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment