5.1 KiB
title, shortTitle, intro, redirect_from, versions
| title | shortTitle | intro | redirect_from | versions | ||||
|---|---|---|---|---|---|---|---|---|
| Configuring Git for GitHub Desktop | Configuring Git | If you don't already have Git installed, you must configure it before using GitHub Desktop. |
|
|
About configuring Git
{% data variables.product.prodname_desktop %} allows you to set the name and email you would like associated with your commits. You can also choose the default branch you would like used when creating new repositories in {% data variables.product.prodname_desktop %}.
{% data variables.product.prodname_desktop %} uses the email address you set in your local Git configuration to connect commits with your account on {% data variables.product.product_name %}. When logged in to your {% data variables.product.product_name %} account the
{% data variables.product.prodname_desktop %} will automatically detect if the email address being used does not match an email address associated with your current user.
{% data reusables.desktop.update-email-address %}
{% tip %}
Tip: Anyone will be able to see the email address in your Git configuration if you make public commits. For more information, see "Setting your commit email address."
{% endtip %}
Configuring your commit details
{% mac %}
{% data reusables.desktop.mac-select-desktop-menu %}
7. In the Preferences window, click Git.
{% 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 %}
8. In the Options window, click Git.
{% data reusables.desktop.name-field-git-config %}
{% data reusables.desktop.select-email-git-config %}
{% data reusables.desktop.click-save-git-config %}

{% endwindows %}
Overriding the email address GitHub Desktop uses for a repository
In {% data variables.product.prodname_desktop %} 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.
Configuring your default branch for new repositories
You can configure the default branch that will be used when creating a new repository in {% data variables.product.prodname_desktop %}. The default branch is the base branch for pull requests and code commits. For more information about the default branch, see "About the default branch."
{% mac %}
{% data reusables.desktop.mac-select-desktop-menu %}
- In the Preferences window, click Git.

- Under "Default branch name for new repositories", select the default branch name you would like to use or select "Other..." to enter a custom name
{% 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 select "Other..." to enter a custom name
{% data reusables.desktop.click-save-git-config %}

{% endwindows %}