How to stop github from adding new commits to existing pull request

In GitHub a Pull Request denotes the request to merge one branch with another. When either branch is updated, the pull-request is updated too and the merge is re-evaluated.

Thus, when you push new changes to a branch that has an outstanding pull request linked to it, the pull request will be updated to include the new changes.

To reset your pull request to a previous state you can:

   git switch branch-you-want-to-fix
   git branch backup-of-later-changes
   git reset --hard hash-of-desired-changes
   git push --force

This will create a new local branch with your later changes and will remove those changes from the branch on github.

The pull-request will be re-evaluated (one of its sides has been updated with your force push), and you can create a new pull request from your backup-of-later-changes branch.

As long as the new commits aren’t pushed to the pr-branch, they won’t automatically appear in it, even if these changes are based on top of your original pr-branch.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)