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

Setting your commit email address on GitHub

  1. GitHub の任意のページの右上隅にあるプロフィール写真をクリックし、[ Settings] をクリックします。

  2. サイドバーの [Access] セクションの [Emails] をクリックします。

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

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

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

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でメールアドレスを設定してください。 任意のメール アドレスを使用できます。

    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でメールアドレスを設定してください。 任意のメール アドレスを使用できます。

    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」をご覧ください。

Next steps

For reference information, see メール アドレスのリファレンス.

To learn more about using a private email address, see メール アドレスのリファレンス.