個人のpcで仕事してたら、間違って自分のuser.nameとuser.emailでコミットしてしまった。
修正手順
何番目からやっちまったのか確認
$ git log
6番目からやっちまってたら
$ git rebase -i HEAD~6 -x "git commit --amend --reuse-message=HEAD --reset-author"
これで現設定のuser情報になる。
あとはpush -fして終わり。もちろんdevelopやmasterでやったらだめ。
リポジトリごとにuser情報分ける
リポジトリごとにuser情報分けるときは、
~/.gitconfig.my
[user]
name = fuga
email = foo@fuga.com
~/.gitconfig.work
...
みたいなのを用意しておいて
$ g config -e
[include]
path = ~/.gitconfig.work
としてuser情報を上書きしてる。