Skip to content

Instantly share code, notes, and snippets.

@officialcjunior
Created September 21, 2020 06:01
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 officialcjunior/bb9ff2df97ec8773ac7687ac6ea7c114 to your computer and use it in GitHub Desktop.
Save officialcjunior/bb9ff2df97ec8773ac7687ac6ea7c114 to your computer and use it in GitHub Desktop.
I use this script to sync my fork with the upstream (original repo).
#!/bin/sh
# fetches the new stuff from upstream. I hope you've added the link to the original repo as 'upstream'
git fetch upstream
git checkout master
# prunes unwanted branches
git fetch --all --prune
# merges without your master
git merge upstream/master
#pushes it up to your fork.
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment