Skip to content

Instantly share code, notes, and snippets.

@skotzko
Last active August 29, 2015 14:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skotzko/9ded6e7464f90f496949 to your computer and use it in GitHub Desktop.
Save skotzko/9ded6e7464f90f496949 to your computer and use it in GitHub Desktop.
Two aliases you can use to update your fork / repo of an OSS project easily. Uses current local branch name for remote target.
# add to .bash_profile
# uses current local branch name for remote target.
# e.g. if on branch 'dev' will fetch & merge upstream/dev into local 'dev' branch
alias branch="git symbolic-ref --short -q HEAD"
alias update_fork='git fetch upstream && git merge upstream/$(branch) $(branch) && $(push)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment