Unwanted merge commits in PR #22397
-
Shown by the image below, in my latest PR (and the one before), there have been 4 commits instead of the intended 1 (the last one (611f1e0) is the only one I wanted). The other 3 commits seem to be from weeks ago. Its quite annoying and messy, and haven’t been able to find a way to remove them after some decent searching. Does anyone know how to get rid of the unwanted commits? (And is there any reason not to?) Thank you :slight_smile: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Those commits look like you merged updates from the branch that you’re trying to merge into. If you want to avoid that, the best solution is probably to start a fresh branch from the current state of the upstream branch, and If you want to avoid such merge commits in the future, you can rebase your branch on top of upstream changes instead of merging them. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help! will give it a go tonight :’) |
Beta Was this translation helpful? Give feedback.
Those commits look like you merged updates from the branch that you’re trying to merge into. If you want to avoid that, the best solution is probably to start a fresh branch from the current state of the upstream branch, and
cherry-pick
your commit on top of that.If you want to avoid such merge commits in the future, you can rebase your branch on top of upstream changes instead of merging them.