Skip to content

Instantly share code, notes, and snippets.

@jaehess
Forked from macournoyer/.gitconfig
Created October 24, 2012 13:51
Show Gist options
  • Select an option

  • Save jaehess/3946160 to your computer and use it in GitHub Desktop.

Select an option

Save jaehess/3946160 to your computer and use it in GitHub Desktop.
Git shortcuts
[alias]
st = status
s = status
co = checkout
ci = commit -a -v
b = branch
d = diff
p = pull
a = add .
l = log
tp = !rake && git push-retry
pmtp = !git pull && rake db:migrate default && git push
ptp = !git pull && rake && git push
tcp = !rake && git cip
cip = !git a && git-cip
aci = !git a && git ci
push-retry = !git push || git ptp
pushed = !git cherry -v `git symbolic-ref HEAD 2> /dev/null`
klog = log --graph --pretty=format:'%an: %s - %Cred%h%Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
stls = ls-files
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; mate `f`"
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
lc = log ORIG_HEAD.. --stat --no-merges
who = log --pretty='format:%Cgreen%an%Creset\t%C(yellow)%ar%Creset\t%s ' --no-merges
unstage = reset HEAD
#!/usr/bin/env ruby
message = "-m \"#{ARGV.first}\"" if ARGV.first
exec "git a && git ci #{message} && git push-retry"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment