I have created and edited a fork, and submitted a pull request. However, there are many commits on it and I would like to remove some of the irrelevant ones. How do I do this?
I have looked at many other answers (such as this one), but they all address slightly different problems, and as I am new to GitHub I don't know how to put them all together.
Thanks.
Interactive rebase works generally, and is almost always a better solution (details here). However, I had problems with it and had to go about it a different way.
1) Re-cloning your fork to another location, something like:
git clone /your-username/your-repo
2) Restart your fork from upstream (details here):
git remote add upstream /url/to/original/repo
git fetch upstream
git checkout master
git reset --hard upstream/master
git push origin master --force`
3) Replace relevant files within repo and commit changes. After making your necessary changes again:
git commit -m "<commit message>"
git push origin <relevant-branch>
Hope this helps someone some time.
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