How do I update a pull request?

Viewed 100

Say I have a pull request, but it is not accepted for a few weeks.

After I fetch, merge, and squash my changes, my pull request appears to involve everyone's changes for those few weeks. How do I update the point at which git considers the pull the request to be from?

git diff HEAD~1

looks perfect.

For some reason my origin's marker to where it was branched from the upstream needs to be updated, but isn't. How do I force that to update?

1 Answers

If the commit history at HEAD~1 is what you wish to exist in your PR, then you can reset your git state to be at that commit and force push.

$ git reset --hard HEAD~1
$ git push --force-with-lease origin <YOUR_BRANCH_NAME>
Related