Skip to content

Instantly share code, notes, and snippets.

@brianlamb
Created November 30, 2019 21:03
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 brianlamb/8555ec4167b5a4dd08b4523fd6d54e4f to your computer and use it in GitHub Desktop.
Save brianlamb/8555ec4167b5a4dd08b4523fd6d54e4f to your computer and use it in GitHub Desktop.
Update a forked repository in GitHub (use local download and git CLI)
https://stackoverflow.com/questions/48765859/github-this-branch-is-n-commits-behind
Don't try it with the github site (it's possible but a bad idea). Instead use the "clean" way and do this from inside the dir with your git-repo:
Tell your repository about the original one:
git remote add upstream git://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
Get the original branches: git fetch upstream
Pull in the original data in to your branch: git pull upstream master
Push this to your github repository: git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment