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 %}. |
|
|
{% 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 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 %}
{% data reusables.desktop.name-field-git-config %} {% data reusables.desktop.select-email-git-config %} {% data reusables.desktop.click-save-git-config %}
{% endwindows %}
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 %}
-
To switch to the repository for which you want to set specific configuration, use the "Current Repository" dropdown menu.
{% 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 %}
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 %}
- 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 %}
-
In the Options window, click Git.
-
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 %}