Created
September 9, 2011 15:41
-
-
Save HungYuHei/1206553 to your computer and use it in GitHub Desktop.
Useful gitconfig aliases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
st = status | |
rso = remote show origin | |
# e.g. git graphviz --first-parent master | dotty /dev/stdin | |
graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f" | |
# Pretty log | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
# Print out all commits whose hash starts with a given string | |
abbr = "!sh -c 'git rev-list --all | grep ^$1 | while read commit; do git --no-pager log -n1 --pretty=format:\"%H %ci %an %s%n\" $commit; done' -" | |
# Two little tweaks to diff | |
changes=diff --name-status -r | |
diffstat=diff --stat -r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment