How to remove commits from pull request
I did a pull request but after that I made some commits to the project locally which ended polluting my pull request, I tried to remove it but without any luck.
I found some similar questions on StackOverflow but I can't apply what in there. It's my first pull request on GitHub so it's kinda strange to me how all of this works.
the highlighted commit is the one I need to keep and remove all the other stuff. it becomes the fourth commit in the history because I make some merge stuff.
my git log
can someone please explain what's going on and how to fix this problem.
You have several techniques to do it.
This post - read the part about the revert will explain in details what we want to do and how to do it.
Here is the most simple solution to your problem:
# Checkout the desired branch
git checkout <branch>
# Undo the desired commit
git revert <commit>
# Update the remote with the undo of the code
git push origin <branch>
The revert command will create a new commit with the undo of the original commit.
So do the following ,
Lets say your branch name is my_branch and this has the extra commits.
Now look at the local branch commit history and make sure everything looks good.
链接地址: http://www.djcxy.com/p/18818.html下一篇: 如何从拉取请求中移除提交