Skip to content

Instantly share code, notes, and snippets.

@sgharms
Created April 9, 2015 20:15
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 sgharms/5b8fbf68b824643563b9 to your computer and use it in GitHub Desktop.
Save sgharms/5b8fbf68b824643563b9 to your computer and use it in GitHub Desktop.
Handy git utilities
add_pr_remotes () {
mv .git/config .git/config-orig
awk '/remote "origin"/ {
print $0
getline;
print $0
getline;
print $0
print "\tfetch = +refs/pull/*/head:refs/remotes/origin/pr/*"
}1' .git/config-orig > .git/config
git fetch origin
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment