3 ms·
Say I don't care about the sanctity of my commit history, and wish to scrub my personal email from all of my public repositories. How would I go about doing thi
by zeta0134 5y ago
Say I don't care about the sanctity of my commit history, and wish to scrub my personal email from all of my public repositories. How would I go about doing this without losing the commits themselves?
- xahrepap 5y agoI’ve found scripts online to help me change the committer on entire repos when I realized I had used the wrong config. Something like the answer here: https://stackoverflow.com/questions/2919878/git-rewrite-previous-commit-usernames-and-emails https://stackoverflow.com/questions/2919878/git-rewrite-prev... Then you have to force push. Note, you will still have the same number of commits in the same order with the same diffs, but they will be new commit ids. You’re “rewriting” your history. Which in the case you outline is perfectly fine. But note, anyone who’s pulled down the branches you’re changing will need to reset rather than pull your changes otherwise git will attempt to MERGE the new history with the old one.
- Arubis 5y agoYou’d have to rewrite the commit history for each of those repos and force push those changes. https://github.com/newren/git-filter-repo https://github.com/newren/git-filter-repo would be a decent starting point.