Skip to content

Instantly share code, notes, and snippets.

@fmasuhr
Created April 8, 2020 12:19
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 fmasuhr/8c3ae9932fac6db7afa1e9cd74435773 to your computer and use it in GitHub Desktop.
Save fmasuhr/8c3ae9932fac6db7afa1e9cd74435773 to your computer and use it in GitHub Desktop.
Git Interactive Rebase a fork

Sync a fork of a repository to keep it up-to-date with the upstream repository.

Inspired by the GitHub documentation

Fetch latest changes of the upstream repository.

git fetch upstream

Checkout the branch you want to sync the upstream into (Usually master).

git checkout master

Start rewriting your forked changes on top of the latest upstream/master.

git rebase upstream/master -i

During the rebase it is now possible to adapt changes to the new upstream/master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment