Reset Git Username and Email

I have a dozen GitHub private repositories (my homework and some silly experiments) and many of them use usernames and email addresses I no longer use, so I want to reset them to what I am currently using (so that I can unlink these email addresses). Here basically I just do what this post tells me to do and adds a few more commands to save some jumping and typing.

# tell your shell the address of the repository you want to edit
$ export url="<repo_url>"
# your shell will download it, edit it, (force) push it,
# brings you back where you were and delete the local copy
# and then you can repeat
$ git clone $url repo; cd bin; git filter-branch -f --env-filter "GIT_AUTHOR_NAME='<new_name>'; GIT_AUTHOR_EMAIL='<new_email_address>'; GIT_COMMITTER_NAME='<new_name>'; GIT_COMMITTER_EMAIL='<new_email_address>';" HEAD; git push --force; cd ..; rm -rf repo;



Writing short notes.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store