r/transprogrammer • u/Clairifyed • Sep 04 '22
Help expunging name from git
Hi all! I have a project I have put a little work into but recently noticed my deadname was embedded in the git commit history, and now I am looking to fix that. Any help would be appreciated!
My local author info is up to date but I had originally created and pulled the project from GitHub which was not up to date. I haven’t actually pushed anything to Github so the one bad commit also happens to be the root and also the only pushed commit. This makes fixing it and updating it “everywhere” tricky and I don’t do much rebasing so I am a bit nervous to touch it 😅 Can anyone walk me though the commands? I am the only one who has ever touched the code so there are no worries about third parties beyond the copy of the root saved to Github itself.
5
u/The-Best-Taylor Sep 04 '22
If it is a personal repo or only used by area people, you can rewrite history as others have said. This is because anyone using the repo will need to do a force pull.
If that is not doable, then I think changing the mail map is the only option.
6
u/inhinias Sep 04 '22
Have a look at this. It's essentially what I've used to change most commits. I haven't found a way to change the root commit yet, as rebase won't allow it. 😒 https://www.git-tower.com/learn/git/faq/change-author-name-email/
7
u/whoami38902 Sep 04 '22
Use a mailmap file, it's not perfect but you can update your name when viewed in git log and other tools.
I posted the same question here a few weeks ago and /u/RealMeIsFoxocube told me about it.
4
u/RaukkM Sep 04 '22
If you're fine with nuking your old commit history, just clearing it and pushing the code as a brand new initial commit is easiest.
I've heard that it's a complete nightmare to edit names in commit history (probably a good thing, or someone would try to fake that they wrote all of __ famous open source project).
2
u/Human-Republic5510 Sep 04 '22
I think you'll need to rewrite past commit history
You might find this helpful: https://www.git-tower.com/learn/git/faq/change-author-name-email
0
u/[deleted] Sep 04 '22
[deleted] — view deleted comment