I have a local git repository in which I worked for some time using my real name and my personal email address. Nobody else has ever worked on it and it has never been pushed to a remote.
Now I want to push this repository to a public remote to allow some other people to work on it, but before doing so I need to completely remove all my sensitive info replacing them with other ones, let's say:
- Name: John Doe → Ntakwetet
- Email: johndoe@gmail.com → user1234@hiddenmail.com
How can I do that in a way that completely removes the original data making impossible to retrieve them in any way from the uploaded repository?
I found some guides suggesting git filter-branch and it seems to work, but I also read (unluckily I can't find the pages anymore) that it leaves traces in some log files and I need to make my data completely unrecoverable.
Please consider that I'm new to git. Also, if more info are needed, please ask for them.
Update
I built this hypothetical serie of commands:
user@pc:~/mylocalrepo$ git filter-branch --env-filter '
if test "$GIT_AUTHOR_EMAIL" = "johndoe@gmail.com"
then
GIT_AUTHOR_EMAIL=user1234@hiddenmail.com
fi
if test "$GIT_AUTHOR_NAME" = "John Doe"
then
GIT_AUTHOR_NAME=Ntakwetet
fi
if test "$GIT_COMMITTER_NAME" = "John Doe"
then
GIT_COMMITTER_NAME=Ntakwetet
fi
if test "$GIT_COMMITTER_EMAIL" = "johndoe@gmail.com"
then
GIT_COMMITTER_EMAIL=user1234@hiddenmail.com
fi
' -- --all
user@pc:~/mylocalrepo$ git remote add origin https://github.com/ntakwetet/remoterepo
user@pc:~/mylocalrepo$ git push origin --all
Does it do what I need?