Skip to content

Instantly share code, notes, and snippets.

@happyrobots
Created April 17, 2013 15:26
Show Gist options
  • Save happyrobots/5405242 to your computer and use it in GitHub Desktop.
Save happyrobots/5405242 to your computer and use it in GitHub Desktop.
[alias]
try-prune = remote prune --dry-run
serve = daemon --reuseaddr --verbose --base-path=. --export-all ./.git
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
st = status
ru = remote update
rv = remote -v
pom = push origin master
pr = pull --rebase
pon = push origin newui
pron = pull --rebase origin newui
changes = diff --name-status -r
diffstat = diff --stat -r
dlc = diff --cached HEAD^
logdiff = log -p
fl = log -u
dl = "!git ll -1"
tree = log --graph --oneline --all
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --graph
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative --graph
who = shortlog -s --
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `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"
ci = commit
br = branch
co = checkout
df = diff
r = reset
r1 = reset HEAD^
r2 = reset HEAD^^
rh = reset --hard
rh1 = reset HEAD^ --hard
rh2 = reset HEAD^^ --hard
oneline ="!_() { $(test $# -eq 0 && echo xargs -L1) git log --no-walk --decorate --oneline \"$@\"; }; _"
tips = "!_() { t=$(git rev-list --no-merges --max-count=1 \"$@\"); if test -n \"$t\"; then echo $t; _ \"$@\" ^$t; fi; }; _"
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment