I seem to be having some issues with merge commits crowding my pull requests that I don't mean to be pushed. Currently I have a local fork with an upstream set to the base repository, and I update my repository like so:
git fetch upstream
git merge upstream/n3960
where n3960
is my branch I am working on, the problem is when I push commits to my fork, I get all of these Merge remote-tracking branch 'upstream/master' into n3960
commits from when I updated my branch whenever another member pushes to the base repo, how can I avoid having all of these merge commits in my pull requests?
An example: my recent pull request is crowded with these Merge remote-tracking branch 'upstream/master' into n3960
commits, I want to try and avoid having these overcrowd my actual commits!
You don't have to merge.
You can:
# rebase n3690 on top of upstream/master
git checkout n3690
git rebase upstream/master
# then
git push -f
By forcing the push, that will update automatically your current Pull Request.
And the rebase avoids all those merge commits.
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