Skip to content

Instantly share code, notes, and snippets.

@jmoon90
Last active April 18, 2016 05:51
Show Gist options
  • Select an option

  • Save jmoon90/6777c5a5fedb227930f68b40a34dfedd to your computer and use it in GitHub Desktop.

Select an option

Save jmoon90/6777c5a5fedb227930f68b40a34dfedd to your computer and use it in GitHub Desktop.
Git alias.
[alias]
copr = "!f() { git fetch -fu origin refs/pull/$1/head:pr-$1; git checkout pr-$1; } ; f"
prunepr = "!git for-each-ref refs/heads/pr-* --format='%(refname:short)' | while read ref ; do git branch -D $ref ; done"
tree = log --pretty=oneline --abbrev-commit --graph --decorate
# Instructions
# 1. add to .gitconfig
# 2. when pulling other people's branch you can use git copr 'pr number'
# e.g git copr 32 // this will pull down the branch
# 3. git prunepr // will remove all git copr pr's
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment