Created
August 25, 2022 22:07
-
-
Save ejona86/aa4f4ec4d5a8acc26d6f13e81279b211 to your computer and use it in GitHub Desktop.
git gh-fetch/gh-push utilities to pull and update PR branches
This file contains hidden or 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/bash | |
if [[ $# -ne 2 ]]; then | |
echo "Usage: $0 REPO_NAME FORK:BRANCH" | |
exit 1 | |
fi | |
repo="$1" | |
user="${2%%:*}" | |
branch="${2#*:}" | |
shift 2 | |
exec git fetch "https://github.com/$user/$repo.git" "$branch" "$@" |
This file contains hidden or 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/bash | |
if [[ $# -ne 2 ]]; then | |
echo "Usage: $0 REPO_NAME FORK:BRANCH" | |
exit 1 | |
fi | |
repo="$1" | |
user="${2%%:*}" | |
branch="${2#*:}" | |
shift 2 | |
exec git push "[email protected]:$user/$repo.git" "HEAD:$branch" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment