Apparently I mistyped my email a long time ago, whenever I was setting up git, and so my email has been incorrect in many repositories (I typed a 0
instead of an o
). I sign all of my commits, so in almost every commit in every repo for years it's said signed off by: <[email protected]>
instead of signed off by: <[email protected]>
. Now I can't just switch my email, so I would like to switch these commit messages.
I've already done the git config --global user.email "[email protected]"
, so this shouldn't be a problem in the future.
Firstly, is it possible to change the messages on this large of a scale without royally messing things up? I've already pushed these changes to multiple servers and others have pulled those changes.
Second, is there a way I could do this quickly in a script? ie:
foreach(commit in log)
{
change "<[email protected]>" to "<[email protected]>"
}
All help is appreciated, and thanks!
If the changesets have already been made public and others have pulled them, then you should not touch them. Modifying them will change their SHAs, which will screw things up for others on a royal scale (see the "Recovering from Upstream Rebase" section on the git rebase
page).
Now that I've mentioned that, suppose hypothetically they hadn't been made public. If that were the case, the tool you'd want to use to modify them all would be git filter-branch
.