Skip to main content

Setting your commit email address

You can set the email address that is used to author commits on GitHub and on your computer.

Platform navigation

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.

Any commits you made prior to changing your commit email address are still associated with your previous email address.

メモ

使い捨てのメールアドレスサービス(一定期間後に期限切れになる一時的なアドレスでメールを受信できるようにしてくれるサービス)からのメールアドレスは検証できません。 メールアドレスをプライベートにしておきたいなら、GitHub が提供する noreply メールアドレスを使ってください。 詳しくは、「Setting your commit email address」をご覧ください。

To use your noreply email address for commits you push from the command line, use that email address when you set your commit email address in Git. To use your noreply address for web-based Git operations, set your commit email address on GitHub and choose to Keep my email address private.

You can also choose to block commits you push from the command line that expose your personal email address. For more information, see Blocking command line pushes that expose your personal 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, or the noreply email address provided to you in your email settings. For more information, see Adding an email address to your GitHub account.

メモ

If you created your account after July 18, 2017, your noreply email address is an ID number and your username in the form of ID+USERNAME@users.noreply.github.com. If you created your account prior to July 18, 2017, and enabled Keep my email address private prior to that date, your noreply email address is USERNAME@users.noreply.github.com. You can get an ID-based noreply email address by selecting (or deselecting and reselecting) Keep my email address private in your email settings.

If you use your noreply email address for GitHub to make commits and then change your username, those commits will not be associated with your account. This does not apply if you're using the ID-based noreply address from GitHub. For more information, see Changing your GitHub username.

Setting your commit email address on GitHub

メール アドレスのプライバシーを有効にしていない場合は、ファイルを編集、削除、または作成したり、ユーザー インターフェイスで pull request をマージしたりするときに、変更の作成にどの検証済みメール アドレスを使用するかを選択できます。 メール アドレスのプライバシーを有効にした場合、コミット作成者のメール アドレスは変更できず、既定で no-reply になります。 no-reply メール アドレスの正確な形式の詳細については、「Setting your commit email address」を参照してください。

  1. GitHub で、任意のページの右上隅にある自分のプロフィール写真をクリックしてから、 [設定] をクリックします。

  2. サイドバーの [アクセス] セクションで、[ メール] をクリックします。

  3. [メール アドレスの追加] にメール アドレスを入力し、 [追加] をクリックします。

  4. メール アドレスを検証します

  5. [プライマリ メール アドレス] ドロップダウン メニューで、Web ベースの Git 操作と関連付けるメール アドレスを選びます。

    [メール] 設定ページのスクリーンショット。 [プライマリ メール アドレス] の下には、Octocat のメール アドレスのラベルが付いたドロップダウン メニューがオレンジ色の枠線で囲まれています。

  6. 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

  1. [ターミナル][ターミナル][Git Bash] を開きます。

  2. Gitでメールアドレスを設定してください。 ご自分の GitHub で提供されたnoreplyメール アドレスまたは任意のメール アドレスを使用できます。

    git config --global user.email "YOUR_EMAIL"
    
  3. Git で正しくメールアドレスが設定されたことを確認してください。

    $ git config --global user.email
    email@example.com
    
  4. 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.

  1. [ターミナル][ターミナル][Git Bash] を開きます。

  2. Change the current working directory to the local repository where you want to configure the email address that you associate with your Git commits.

  3. Gitでメールアドレスを設定してください。 ご自分の GitHub で提供されたnoreplyメール アドレスまたは任意のメール アドレスを使用できます。

    git config user.email "YOUR_EMAIL"
    
  4. Git で正しくメールアドレスが設定されたことを確認してください。

    $ git config user.email
    email@example.com
    
  5. GitHub でアカウントにメール アドレスを追加して、コミットが自身に帰属し、自身のコントリビューション グラフに表示されるようにします。 詳しくは、「Adding an email address to your GitHub account」をご覧ください。