Skip to content

Instantly share code, notes, and snippets.

@starkcoffee
Last active October 27, 2015 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save starkcoffee/402ca19b5b25e9f56b16 to your computer and use it in GitHub Desktop.
Save starkcoffee/402ca19b5b25e9f56b16 to your computer and use it in GitHub Desktop.
Git aliases
[alias]
st = status
ca = commit -am
co = checkout
branch-name = !git branch 2>/dev/null | grep -e ^* | tr -d '* '
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
compare = !"open https://github.com/soundcloud/`echo ${PWD##*/}`/compare/`git branch-name`"
implode = !"BN=`git branch-name` && [ $BN != 'master' ] && git co master && git branch -D $BN && git push origin :$BN"
un = !git status --porcelain | grep '??' | awk '{ print $2}'
corb = !git checkout -t
@starkcoffee
Copy link
Author

ripped from @rngtng

@starkcoffee
Copy link
Author

the compare only works in my soundcloud organization. needs to be generified.

@rngtng
Copy link

rngtng commented Oct 27, 2015

here my updates, using hub (brew install hub) to get compare working everyhere

branch-name = symbolic-ref --short HEAD
compare = !hub compare `git branch-name`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment