0

A couple of weeks ago I made multiple commits to one of my repositories without my git credentials or any keys/SSH, so my commit history looks like this:

Github Commit History

Is there a way to fix it and make it look like my actual GitHub account was the one making those commits?

nogabt
  • 1
  • 1
  • "Is there a way to fix it and make it look like my actual GitHub account was the one making those commits?" - yes, provided you don't mind a very painful rebasing. This is because every commit's hash-identifier includes the hash of the author's details - if you're retroactively changing the author's details then you'll need to re-commit those commits. – Dai Jan 07 '22 at 00:00
  • You cannot change any existing commit. The two things that you *can* do are: (1) copy old (and lousy?) to new (improved) commits; or—this one is GitHub-specific—claim to be more than one email address on GitHub. The second one does not have any cryptographic security. – torek Jan 07 '22 at 00:01
  • 2
    Does this answer your question? [How to amend several commits in Git to change author](https://stackoverflow.com/questions/4981126/how-to-amend-several-commits-in-git-to-change-author) – J. Titus Jan 07 '22 at 02:43
  • @J.Titus I'm afraid not since the user in that thread didn't push the commits, and I have – nogabt Jan 08 '22 at 04:35
  • @nogabt You would need to do a push with `--force` after updating your commits with the correct author. The history will be re-written in your repository with the updates. – J. Titus Jan 08 '22 at 14:02

0 Answers0