About commit email addresses
GitHub uses your commit email address to associate commits with your account on GitHub. You can choose the email address that will be associated with the commits you push from the command line as well as web-based Git operations you make.
For web-based Git operations, you can set your commit email address on GitHub. For commits you push from the command line, you can set your commit email address in Git.
After changing your commit email address on GitHub, the new email address will be visible in all of your future web-based Git operations by default. Any commits you made prior to changing your commit email address are still associated with your previous email address.
To ensure that commits are attributed to you and appear in your contributions graph, use an email address that is connected to your account on GitHub. For more information, see Adding an email address to your GitHub account.
Setting your commit email address on GitHub
-
GitHub で、任意のページの右上隅にある自分のプロフィール写真をクリックしてから、 [設定] をクリックします。
-
サイドバーの [アクセス] セクションで、[ メール] をクリックします。
-
[メール アドレスの追加] にメール アドレスを入力し、 [追加] をクリックします。
-
[プライマリ メール アドレス] ドロップダウン メニューで、Web ベースの Git 操作と関連付けるメール アドレスを選びます。
Setting your commit email address in Git
You can use the git config
command to change the email address you associate with your Git commits. The new email address you set will be visible in any future commits you push to GitHub from the command line. Any commits you made prior to changing your commit email address are still associated with your previous email address.
Setting your email address for every repository on your computer
-
[ターミナル][ターミナル][Git Bash] を開きます。
-
Gitでメールアドレスを設定してください。 任意のメール アドレスを使用できます。
git config --global user.email "YOUR_EMAIL"
-
Git で正しくメールアドレスが設定されたことを確認してください。
$ git config --global user.email email@example.com
-
GitHub でアカウントにメール アドレスを追加して、コミットが自身に帰属し、自身のコントリビューション グラフに表示されるようにします。 詳しくは、「Adding an email address to your GitHub account」をご覧ください。
Setting your email address for a single repository
GitHub uses the email address set in your local Git configuration to associate commits pushed from the command line with your account on GitHub.
You can change the email address associated with commits you make in a single repository. This will override your global Git configuration settings in this one repository, but will not affect any other repositories.
-
[ターミナル][ターミナル][Git Bash] を開きます。
-
Change the current working directory to the local repository where you want to configure the email address that you associate with your Git commits.
-
Gitでメールアドレスを設定してください。 任意のメール アドレスを使用できます。
git config user.email "YOUR_EMAIL"
-
Git で正しくメールアドレスが設定されたことを確認してください。
$ git config user.email email@example.com
-
GitHub でアカウントにメール アドレスを追加して、コミットが自身に帰属し、自身のコントリビューション グラフに表示されるようにします。 詳しくは、「Adding an email address to your GitHub account」をご覧ください。