I just noticed that I pushed some code commited with the wrong user name and email, and for privacy I'd that to not leak on google. Is it possible to re-edit and remove/change these names from my commits? I can't even see this name and email on github, so I don't know where it goes
Asked
Active
Viewed 92 times
0
-
It goes inside your commits. You probably set that up when you first started using git: https://docs.github.com/en/get-started/getting-started-with-git/setting-your-username-in-git and https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/setting-your-commit-email-address. – Thomas Feb 14 '22 at 13:39
-
2Does this answer your question? [How to change the author and committer name and e-mail of multiple commits in Git?](https://stackoverflow.com/questions/750172/how-to-change-the-author-and-committer-name-and-e-mail-of-multiple-commits-in-gi) And then force-push it to GitHub. – Thomas Feb 14 '22 at 13:40
1 Answers
0
Could this be a possible solution?
$ git commit -m "in this commit you have inserted unwanted info"
$ git reset HEAD~
[edit your files properly]
$ git add .
$ git commit -c ORIG_HEAD

andreasp
- 1
- 2