Skip to content

Instantly share code, notes, and snippets.

@unRARed
Created February 3, 2015 07:28
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 unRARed/08a392a7d637b722ef24 to your computer and use it in GitHub Desktop.
Save unRARed/08a392a7d637b722ef24 to your computer and use it in GitHub Desktop.
Bash alias for keeping master branch in sync with upstream repository to better prevent conflicts.
alias sync_master='WORKING_BRANCH="$(git rev-parse --abbrev-ref HEAD)" && git checkout master && git fetch upstream master && git reset --hard upstream/master && git checkout $WORKING_BRANCH'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment