Created
February 9, 2015 09:25
-
-
Save chernjie/b16fe4dccf3f386d52ff to your computer and use it in GitHub Desktop.
Fetch Github's Pull Request as a remote branch
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
#!/usr/bin/env bash | |
git remote -v | grep fetch | grep github | \ | |
while read remote url _; do | |
if ! git config --get-all "remote.$remote.fetch" | grep -q refs/pull | |
then | |
git config --add "remote.$remote.fetch" \ | |
'+refs/pull/*/head:refs/remotes/'"$remote"'/pull/*' | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
c/o @hyperair