Last active
July 5, 2017 06:49
-
-
Save hyperair/e78d325577187db22ac5 to your computer and use it in GitHub Desktop.
Setup pull request fetching for github repo
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
#!/bin/sh | |
git remote -v | grep fetch | \ | |
grep -e git@github.com -e git://github -e github: -e gh: | \ | |
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"'/pr/*' | |
git config --add "remote.$remote.fetch" \ | |
'+refs/pull/*/merge:refs/remotes/'"$remote"'/prm/'* | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment