1

I've merged a large commit to it's remote origin that is attributed to the wrong author. I know how to fix this for an unmerged commit, but I'm not sure how this process would work when trying to fix an already merged commit.

I can change the author of the commit locally with:

git commit --amend --reset-author

This will correct the author of the commit to my local git user.name and user.email.

However, I'm not sure how to then overwrite the already merged commit with the corrected local commit. Is there a way to do this without getting into anything overly complicated? Would git push -f overwrite the commit that was merged into master? Do I have to revert the commit? Not totally sure how to approach this.

123
  • 8,733
  • 14
  • 57
  • 99

1 Answers1

0

Do what they said (git commit --amend --author="Author Name <email@address.com>") and push -f it before someone adds more stuff on top of this (or at least this seemed to work correctly for me on a local repo that I tried it on).

David Neiss
  • 8,161
  • 2
  • 20
  • 21