Skip to content

Files

Latest commit

Feb 25, 2025
93420a2 · Feb 25, 2025

History

History
114 lines (77 loc) · 6.36 KB

configuring-git-for-github-desktop.md

File metadata and controls

114 lines (77 loc) · 6.36 KB
title shortTitle intro redirect_from versions
Configuring Git for GitHub Desktop
Configuring Git
You can manage Git configuration settings for your local repositories with {% data variables.product.prodname_desktop %}.
/desktop/getting-started-with-github-desktop/configuring-git-for-github-desktop
/desktop/installing-and-configuring-github-desktop/configuring-git-for-github-desktop
/desktop/installing-and-configuring-github-desktop/configuring-and-customizing-github-desktop/configuring-git-for-github-desktop
fpt ghec ghes
*
*
*

About Git configuration for {% data variables.product.prodname_desktop %}

{% data variables.product.prodname_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.

{% data variables.product.prodname_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, {% data variables.product.prodname_desktop %} will detect and use those values. {% data variables.product.prodname_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 {% data variables.product.github %} account you are currently logged in to, {% data variables.product.prodname_desktop %} will show a warning prior to committing.

{% data variables.product.prodname_desktop %} also allows you to change the default branch name that you would like to use when creating new repositories. By default, {% data variables.product.prodname_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 AUTOTITLE.

Configuring your global author information

Configuring your global author information in {% data variables.product.prodname_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 {% data variables.product.prodname_desktop %}.

{% mac %}

{% data reusables.desktop.mac-select-desktop-menu %} {% data reusables.desktop.settings-git-pane %} {% data reusables.desktop.name-field-git-config %} {% data reusables.desktop.select-email-git-config %} {% data reusables.desktop.click-save-git-config %}

{% endmac %}

{% windows %}

{% data reusables.desktop.windows-choose-options %}

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

{% data reusables.desktop.name-field-git-config %} {% data reusables.desktop.select-email-git-config %} {% data reusables.desktop.click-save-git-config %}

{% endwindows %}

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.

{% mac %}

  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.

{% data reusables.desktop.mac-repository-settings-menu %} {% data reusables.desktop.select-git-config %} {% data reusables.desktop.use-local-git-config %} {% data reusables.desktop.local-config-name %} {% data reusables.desktop.select-email-git-config %} {% data reusables.desktop.repository-settings-save %}

{% endmac %}

{% windows %}

{% data reusables.desktop.windows-repository-settings-menu %} {% data reusables.desktop.select-git-config %} {% data reusables.desktop.use-local-git-config %} {% data reusables.desktop.local-config-name %} {% data reusables.desktop.select-email-git-config %} {% data reusables.desktop.repository-settings-save %}

{% endwindows %}

Configuring your default branch for new repositories

You can configure the default branch that will be used when you create a new repository in {% data variables.product.prodname_desktop %}. For more information about the default branch, see AUTOTITLE.

{% mac %}

{% data reusables.desktop.mac-select-desktop-menu %} {% data reusables.desktop.settings-git-pane %}

  1. Optional, under "Default branch name for new repositories" edit the name of the default branch as needed. {% data reusables.desktop.click-save-git-config %}

{% endmac %}

{% windows %}

{% data reusables.desktop.windows-choose-options %}

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

  2. 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...". {% data reusables.desktop.click-save-git-config %}

{% endwindows %}

Further reading