Skip to main content

Configuring Git for GitHub Desktop

You can manage Git configuration settings for your local repositories with GitHub Desktop.

Platform navigation

About Git configuration for GitHub Desktop

GitHub Desktop uses your local Git configuration settings and provides the option to configure some of these settings, such as the global author information and the default branch that is used when creating a new repository.

GitHub Desktop allows you to set the name and email address you would like associated with the commits you make in your repositories. If your name and email address have already been set in the global Git configuration for your computer, GitHub Desktop will detect and use those values. GitHub Desktop also allows you to set a different name and email address for an individual repository. This is useful when you need to use a separate work email address for a specific repository.

If the email address that has been set in your Git configuration does not match an email address associated with the GitHub account you are currently logged in to, GitHub Desktop will show a warning prior to committing.

GitHub Desktop also allows you to change the default branch name that you would like to use when creating new repositories. By default, GitHub Desktop uses main as the default branch name in any new repositories you create.

Tip: Anyone will be able to see the email address in your Git configuration if you make public commits. For more information, see "コミットメールアドレスを設定する."

Configuring your global author information

Configuring your global author information in GitHub Desktop will update the name and email address in your global Git configuration. This will be the default name and email address for all new local repositories you create in GitHub Desktop.

  1. メニュー バーで [GitHub Desktop] を選び、 [環境設定] をクリックします。

    Mac のメニュー バーのスクリーンショット。 [GitHub Desktop] が開いており、青色で強調表示されている [環境設定] の上にカーソルが置かれています。

  2. [基本設定] ウィンドウで、 [Git] をクリックします。

    [基本設定] ウィンドウの [Git] ペインのスクリーンショット。 左側のサイドバーに、"Git" というラベルが付いたオプションが青色で強調表示され、オレンジ色の枠線で囲まれています。

  3. "名前" フィールドに、自分の Git 構成に使う名前を入力します。

  4. [メール] ドロップダウン メニューで、コミットに使うメール アドレスを選びます。 GitHub アカウントに関連付けられているメール アドレスを選ぶか、[その他] を選んで別のメール アドレスを入力することができます。

  5. 保存をクリックします。

  1. [ファイル] メニューを使用し、 [オプション] をクリックします。

    Windows の [GitHub Desktop] メニュー バーのスクリーンショット。 [ファイル] ドロップダウン メニューが展開されており、[オプション] 項目がオレンジ色の枠線で強調表示されています。

  2. In the "Options" window, click Git.

    Screenshot of the "Git" pane in the "Options" window. In the left sidebar, an option labeled "Git" is highlighted in blue and outlined in orange.

  3. "名前" フィールドに、自分の Git 構成に使う名前を入力します。

  4. [メール] ドロップダウン メニューで、コミットに使うメール アドレスを選びます。 GitHub アカウントに関連付けられているメール アドレスを選ぶか、[その他] を選んで別のメール アドレスを入力することができます。

  5. 保存をクリックします。

Configuring different author information for an individual repository

You can change the name and email address used to author commits in a specific repository. This local Git configuration will override your global Git configuration settings for this one repository only.

  1. To switch to the repository for which you want to set specific configuration, use the "Current Repository" dropdown menu.

    Screenshot of the repository bar in GitHub Desktop. Next to "Current Repository", a dropdown icon is highlighted with an orange outline.

  2. [GitHub Desktop] メニュー バーで、 [リポジトリ] を選び、 [リポジトリの設定...] をクリックします。

    Mac のメニュー バーのスクリーンショット。 [リポジトリ] ドロップダウン メニューが開いており、青色で強調表示されている [リポジトリの設定] にカーソルが置かれています。

  3. [リポジトリの設定] ウィンドウの左側のサイドバーで、 [Git 構成] をクリックします。

  4. [このリポジトリの場合] で、 [ローカルの Git 構成を使用する] を選びます。[リポジトリの設定] ウィンドウの [Git 構成] ペインのスクリーンショット。 "ローカルの Git 構成を使用する" というラベルが付いたラジオ ボタンが選択され、オレンジ色の枠線で囲まれています。

  5. "名前" フィールドで、ローカルで Git の設定に使いたい名前を入力してください。

  6. [メール] ドロップダウン メニューで、コミットに使うメール アドレスを選びます。 GitHub アカウントに関連付けられているメール アドレスを選ぶか、[その他] を選んで別のメール アドレスを入力することができます。

  7. 保存をクリックします。

  1. [リポジトリ] メニューを開き、 [リポジトリの設定...] をクリックします。

    Windows の [GitHub Desktop] メニュー バーのスクリーンショット。 [リポジトリ] ドロップダウン メニューが開いており、[リポジトリの設定] というラベルが付いたオプションがオレンジ色の枠線で囲まれています。

  2. [リポジトリの設定] ウィンドウの左側のサイドバーで、 [Git 構成] をクリックします。

  3. [このリポジトリの場合] で、 [ローカルの Git 構成を使用する] を選びます。[リポジトリの設定] ウィンドウの [Git 構成] ペインのスクリーンショット。 "ローカルの Git 構成を使用する" というラベルが付いたラジオ ボタンが選択され、オレンジ色の枠線で囲まれています。

  4. "名前" フィールドで、ローカルで Git の設定に使いたい名前を入力してください。

  5. [メール] ドロップダウン メニューで、コミットに使うメール アドレスを選びます。 GitHub アカウントに関連付けられているメール アドレスを選ぶか、[その他] を選んで別のメール アドレスを入力することができます。

  6. 保存をクリックします。

Configuring your default branch for new repositories

You can configure the default branch that will be used when you create a new repository in GitHub Desktop. For more information about the default branch, see "ブランチの概要."

  1. メニュー バーで [GitHub Desktop] を選び、 [環境設定] をクリックします。

    Mac のメニュー バーのスクリーンショット。 [GitHub Desktop] が開いており、青色で強調表示されている [環境設定] の上にカーソルが置かれています。

  2. [基本設定] ウィンドウで、 [Git] をクリックします。

    [基本設定] ウィンドウの [Git] ペインのスクリーンショット。 左側のサイドバーに、"Git" というラベルが付いたオプションが青色で強調表示され、オレンジ色の枠線で囲まれています。

  3. Under "Default branch name for new repositories", select the default branch name you would like to use, or, to enter a custom name, select "Other...".

  4. 保存をクリックします。

  1. [ファイル] メニューを使用し、 [オプション] をクリックします。

    Windows の [GitHub Desktop] メニュー バーのスクリーンショット。 [ファイル] ドロップダウン メニューが展開されており、[オプション] 項目がオレンジ色の枠線で強調表示されています。

  2. In the Options window, click Git.

    Screenshot of the "Git" pane in the "Options" window. In the left sidebar, an option labeled "Git" is highlighted in blue and outlined in orange.

  3. Under "Default branch name for new repositories", select the default branch name you would like to use, or, to enter a custom name, select "Other...".

  4. 保存をクリックします。

Further reading