Created
May 21, 2018 21:03
-
-
Save mhartington/d0c93d31d3cd5a0c3b15c46a06fbb44f to your computer and use it in GitHub Desktop.
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
function ghUpdate() { | |
if git remote | grep upstream > /dev/null; then | |
echo "upstream is set" | |
elif [ -z "$1" ]; then | |
read "?Whats the URl of the original repo? " answer | |
git remote add upstream $answer | |
else | |
git remote add upstream $1 | |
fi | |
git fetch upstream | |
git checkout master | |
git rebase upstream/master | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment