Last active
May 19, 2020 21:43
-
-
Save LoganBarnett/b179e1f6d7a898879357c6128d339d80 to your computer and use it in GitHub Desktop.
Switch to using a git fork. Original "origin" becomes "upstream".
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 | |
# -*- shell-mode -*- | |
if [ "$1" == "" ]; then | |
echo "Usage: use-fork <forked clone URL>" | |
exit 1 | |
fi | |
# Go to the repo involved and click fork | |
original_url="$(git remote get-url origin)" | |
git remote remove origin | |
git remote add origin $1 | |
git remote add upstream $original_url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment