Did you know anyone can view your Git commit email, just by adding .patch
to the end of a public Github commit URL? Try it!
This repo allows you to specify a list of repos you'd like to have their Git commit author details rewritten. Say, for example, you've used your personal email address for all Git commits in the past and now you want to hide them all.
It uses uses git filter-repo under the hood to perform rewrites.
Install git filter-repo on your machine.
-
Create a list of repo names
An easy way to get all your repo names is to navigate to your personal Github repositories page (i.e.
github.com/<username>?tab=repositories
), and run the following script in the browser console:let store = "" document.querySelectorAll('#user-repositories-list > ul > li > div > div > h3 > a').forEach(a => {store += (a.innerText + "\n")}) console.log(store)
The good thing is you can use Github's filter on the page to select specific repositories (e.g. only Public repos)
-
Save the list into
repos.txt
, without newline at the end -
Add your username to
clone.sh
andrun.sh
, in theusername
Bash variable -
In the
mailmap
file, input the list of emails you'd like to rewrite -
Clone your repos using
chmod +x clone.sh && ./clone.sh
-
Perform the rewrite using
chmod +x run.sh && ./run.sh
That's it! It shouldn't take more than 20 minutes for the whole process.