Skip to content

Instantly share code, notes, and snippets.

@mvidaldp
Created August 19, 2020 14:43
Show Gist options
  • Save mvidaldp/36064ac60ae08eb999e3497b02958b21 to your computer and use it in GitHub Desktop.
Save mvidaldp/36064ac60ae08eb999e3497b02958b21 to your computer and use it in GitHub Desktop.
Set GitHub fork even with the master branch. Aka gitHub says "This branch is X commits ahead, Y commits behind" after pull requests merged.

Assuming your are inside your fork folder and the pull requests you did were accepted and so merged into the master branch of the repo. Run once at first:

git remote add upstream https://github.com/upstream/repo.git

Then whenever you want to make your fork even (sync changes), run:

git pull --rebase upstream master
git push --force-with-lease origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment