Skip to content

Instantly share code, notes, and snippets.

@thisisnic
Last active April 12, 2021 08:35
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 thisisnic/f62c3c4660d74bacb70a8b0c4e5311ae to your computer and use it in GitHub Desktop.
Save thisisnic/f62c3c4660d74bacb70a8b0c4e5311ae to your computer and use it in GitHub Desktop.
git rebase when you have a PR open on my-branch but the upstream/master branch has new commits
# checkout the branch you're working on
git checkout my-branch
# fetch all branches from the upstream repo
git fetch upstream
# rebase your changes on top of the upstream master branch
git rebase upstream/master
# force push your changes to your branch
git push --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment