Skip to content

Instantly share code, notes, and snippets.

@tbjers
Created March 21, 2013 17:51
Show Gist options
  • Save tbjers/5215096 to your computer and use it in GitHub Desktop.
Save tbjers/5215096 to your computer and use it in GitHub Desktop.
git aliases I cannot live without...
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
sync = !sh -c 'git pull && git diff --quiet HEAD || (git commit $1 && git push)' -
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; sublime_text `f`"
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f"
who = shortlog -s --
new = !sh -c 'git lg $1@{1}..$1@{0} "$@"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment