Created
April 8, 2015 16:56
-
-
Save philpennock/e5b1654a6c4f403cd046 to your computer and use it in GitHub Desktop.
Bourne-shell snippet for fixing up a git repo cloned from github to add the PR fetch set, for CLI diff of a PR.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
origin_url=$(git config --local --get remote.origin.url) | |
case $origin_url in | |
github:*|git@github.*|*//github.*) | |
fetches="$(git config --local --get-all remote.origin.fetch)" | |
case $fetches in | |
*origin/pr/*) # no action | |
;; | |
*) | |
git config --local --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*' | |
;; | |
esac | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment