Help us understand the problem. What is going on with this article?

Gitで間違えたメールアドレスを設定してコミットしてしまったときの対処

More than 5 years have passed since last update.

経緯

  • メールアドレスが間違った状態でgitを使っていたところContributionsの色が付かなくなる事案が発生(赤枠のところ)
  • 今月は毎日commitするぞい!と思ってたので悲しい

スクリーンショット 2015-03-03 23.52.18.png

対応方法

  • そんなときにこのコマンドを使えば、メアドを正しいものに戻せました
git filter-branch --commit-filter '
        if [ "$GIT_COMMITTER_EMAIL" = "tjinjin@example.com" ];
        then
                GIT_COMMITTER_NAME="tjinjin"
                GIT_COMMITTER_EMAIL="tjinjin@example.jp"
                GIT_AUTHOR_EMAIL="tjinjin@example.jp"
                git commit-tree "$@"
        else
                git commit-tree "$@"
        fi' -- --all

今回の場合はGIT_COMMITTER_EMAILが誤っているものを変更しています。この部分を変更すればいろいろできそうですね。

注意事項

修正後はforce pushするので使い方にはご注意ください。

tjinjin
平和に生きたいインフラエンジニア
http://cross-black777.hatenablog.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした