Skip to content

Instantly share code, notes, and snippets.

@Richienb
Created July 19, 2020 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Richienb/8021a39b217f3a68120e1bb1c2a30819 to your computer and use it in GitHub Desktop.
Save Richienb/8021a39b217f3a68120e1bb1c2a30819 to your computer and use it in GitHub Desktop.
Synchronise the current branch of a fork with the upstream repository.
UPSTREAM_BRANCH=$1
if [ -z "$UPSTREAM_BRANCH" ]; then
UPSTREAM_BRANCH=$(git branch --show-current)
fi
git fetch upstream &&
git merge upstream/${UPSTREAM_BRANCH}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment