Basically I used Github revert button to revert a previous PR for a feature branch into master
, then I decided to merge the same feature branch that I reverted earlier, but I was not able to do so. Steps as follow:
master
master
)master
again.There isn't anything to compare.
master is up to date with all commits from feature-branch. Try switching the base for your comparison.
Any suggestions on how can I merge feature branch again into master
Revert a merge request After you select that button, a modal appears where you can choose to revert the changes directly into the selected branch or you can opt to create a new merge request with the revert changes. After the merge request has been reverted, the Revert button is no longer available.
You can use the Git reset command to undo a merge. Firstly, you need to check for the commit hash (or id) so you can use it to go back to the previous commit. To check for the hash, run git log or git reflog . git reflog is a better option because things are more readable with it.
1 Go the the Revert PR and click "Revert" (But don't merge it) 2 Do git fetch 3 Do git checkout <name of revert's revert> More ...
Reverting a pull request on GitHub creates a new pull request that contains one revert of the merge commit from the original merged pull request. To revert pull requests, you must have write permissions in the repository.
You can revert a pull request after it's been merged to the upstream branch. Reverting a pull request on GitHub creates a new pull request that contains one revert of the merge commit from the original merged pull request.
To merge a pull request, use the gh pr merge subcommand. Replace pull-request with the number, URL, or head branch of the pull request. Follow the interactive prompts to complete the merge. For more information about the merge methods that you can choose, see " About pull request merges ."
Just revert the revert. So by clicking the revert button you will have created a new PR (your step 2). Once this is merged, you will have the option to revert this, which will create a new branch with all your changes back in. You can then pull this, make changes to it (if needed) and create a new PR. You will lose all the commit messages on Github, but all file changes will still be around. Good to refer to your original branch and reverts in the new PR.
Anything to avoid a complicated rebase or force pushing to master.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With