Changing Git Authors
220 words · 2 minutes
Changing Git Author/Email Based on Previously Committed Email
Here's the dilemma: You've been committing changes to your git repository with an incorrect name or email (or multiple repositories) and now you want to fix it. Luckily there's a semi-reliable way to fix that. While I have never experienced issues with this method, some people have warned that it can mess with historical hashes and integrity of commits, so use this method only if you're okay accepting that risk.
Okay, let's create the bash script:
The following information can be pasted directly into your bash script. The only changes you need to make are to the following variables:
#!/bin/sh # List all sub-directories in the current directory for do # Remove the trailing "/" dir= # Enter sub-directory done
Finally, save the bash script and make it executable.
Now you can run the script and should see the process begin.