Skip to content

Instantly share code, notes, and snippets.

@olegchir
Forked from jessesquires/readme.md
Created May 21, 2017 11:59
Show Gist options
  • Select an option

  • Save olegchir/582e1e394f785680eff206ec2b554cb1 to your computer and use it in GitHub Desktop.

Select an option

Save olegchir/582e1e394f785680eff206ec2b554cb1 to your computer and use it in GitHub Desktop.
Script for Syncing a Fork
# Assumes that the git repository has upstream and remote urls set
# Assumes that you've committed your work on your current branch
current_branch=$(git rev-parse --abbrev-ref HEAD)
git fetch upstream
git checkout master
git merge upstream/master
git push # origin
git checkout $current_branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment