Rebase discards merges by default, as in the linked question.
A pull request is, in essence, sending a message to someone else asking them to merge or rebase your commit(s) into their work, so the first question to answer is whether you need your own merge in this series of commits. If they choose to rebase your series of commits, their rebase will discard your merge anyway. (This is also true if they choose the non-merge "squash" option on GitHub. You can make pull requests the old-school way without GitHub, but since you have tagged this with github I will assume that you made the pull request using GitHub too.)
If they are going to merge, though, then your merge will be included in the series of commits they add to their repository when they merge your commits. In that case, you might want to replace your existing merge commit (with its incorrect author) with a new corrected merge commit (with correct author). That could be fairly hard, if it's not right at the tip of your series of commits. In that case, do see the answers to Rebasing a Git merge commit, and note that git rebase --preserve-merges
actually re-performs the merge.
You might also consider using git filter-branch
to change just one commit, as in Change the author and committer name and e-mail of multiple commits in Git but using the $GIT_COMMIT
variable to test for the one specific commit hash ID. Note that filter-branch is tricky to use correctly; always experiment on a copy of the repository.
If the merge commit is right at the tip of the commits you're asking someone else to pull, though, there is a much easier way to do this: just use git commit --amend --reset-author
. The --amend
code knows how to copy a merge commit to an amended merge commit, and since there are no commits after the merge commit, there are no subsequent commits that require a copy-with-something-changed operation to use the new "amended" commit's new hash ID.
(The filter-branch
and interactive-rebase code are complicated in part because once you've copied-but-adjusted a commit in the middle of a series of commits, every subsequent commit must also be copied-but-adjusted, to use the new hash ID of their replacement parent. When using git commit --amend
, there are no subsequent commits, so this complication simply vanishes.)