Skip to content

Commit

Permalink
Merge pull request #18146 from github/desktop-configuring-git
Browse files Browse the repository at this point in the history
Update "Configuring Git for GitHub Desktop" article
  • Loading branch information
steveward authored Jun 3, 2022
2 parents 52bb200 + 6fe6fe7 commit c1c5fda
Show file tree
Hide file tree
Showing 26 changed files with 96 additions and 30 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/help/desktop/local-config-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/mac-email-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/mac-name-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/mac-save-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/help/desktop/select-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/windows-email-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/windows-name-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/desktop/windows-save-git-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,18 @@ shortTitle: Change a remote's URL
---
{% mac %}

1. In the **Repository** menu, click **Repository Settings...**.
![Repository Settings menu option](/assets/images/help/desktop/repository-settings-mac.png)
2. In the **Primary remote repository** field, type the desired URL.
![Primary remote repository field](/assets/images/help/desktop/repository-settings-remote-mac.png)
3. Click **Save**.
![The Save button](/assets/images/help/desktop/repository-settings-save-mac.png)
{% data reusables.desktop.mac-repository-settings-menu %}
2. Click **Remote**, and, under **Primary remote repository**, type the desired URL.
![Primary remote repository field](/assets/images/help/desktop/repository-settings-remote.png)
{% data reusables.desktop.repository-settings-save %}

{% endmac %}

{% windows %}

1. In the **Repository** menu, click **Repository settings...**.
![Repository settings menu option](/assets/images/help/desktop/repository-settings-win.png)
2. In the **Primary remote repository** field, type the desired URL.
![Primary remote repository field](/assets/images/help/desktop/repository-settings-remote-win.png)
3. Click **Save**.
![The Save button](/assets/images/help/desktop/repository-settings-save-win.png)
{% data reusables.desktop.windows-repository-settings-menu %}
2. Click **Remote**, and, under **Primary remote repository**, type the desired URL.
![Primary remote repository field](/assets/images/help/desktop/repository-settings-remote.png)
{% data reusables.desktop.repository-settings-save %}

{% endwindows %}
Original file line number Diff line number Diff line change
@@ -1,62 +1,118 @@
---
title: Configuring Git for GitHub Desktop
shortTitle: Configuring Git
intro: 'If you don''t already have Git installed, you must configure it before using GitHub Desktop.'
intro: 'You can manage Git configuration settings for your local repositories with {% data variables.product.prodname_desktop %}.'
redirect_from:
- /desktop/getting-started-with-github-desktop/configuring-git-for-github-desktop
- /desktop/installing-and-configuring-github-desktop/configuring-git-for-github-desktop
versions:
fpt: '*'
---
{% 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 %}.
## About Git configuration for {% data variables.product.prodname_desktop %}

{% data reusables.desktop.update-email-address %}
{% 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.product_name %} 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 %}

**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](/articles/setting-your-commit-email-address/)."

{% endtip %}

## 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.sign-in-choose-product %}
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.emails %}
{% data reusables.desktop.copy-email-git-config %}
{% data reusables.desktop.return-to-desktop %}
{% data reusables.desktop.mac-select-desktop-menu %}
7. In the Preferences window, click **Git**.
![The Git Pane in the Preferences menu](/assets/images/help/desktop/mac-select-git-pane.png)
{% data reusables.desktop.name-field-git-config %}
![The name field of the Git configuration](/assets/images/help/desktop/mac-name-git-config.png)
{% data reusables.desktop.paste-email-git-config %}
![Pasted email address in Git configuration field](/assets/images/help/desktop/mac-email-git-config.png)
{% data reusables.desktop.select-email-git-config %}
![Select email address in Git configuration field](/assets/images/help/desktop/mac-email-git-config.png)
{% data reusables.desktop.click-save-git-config %}
![Save button in Git configuration field](/assets/images/help/desktop/mac-save-git-config.png)

{% endmac %}

{% windows %}

{% data reusables.desktop.sign-in-choose-product %}
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.emails %}
{% data reusables.desktop.copy-email-git-config %}
{% data reusables.desktop.return-to-desktop %}
{% data reusables.desktop.windows-choose-options %}
8. In the Options window, click **Git**.
![The Git Pane in the Options menu](/assets/images/help/desktop/windows-select-git-pane.png)
{% data reusables.desktop.name-field-git-config %}
![The name field of the Git configuration](/assets/images/help/desktop/windows-name-git-config.png)
{% data reusables.desktop.paste-email-git-config %}
![Pasted email address in Git configuration field](/assets/images/help/desktop/windows-email-git-config.png)
{% data reusables.desktop.select-email-git-config %}
![Select email address in Git configuration field](/assets/images/help/desktop/windows-email-git-config.png)
{% data reusables.desktop.click-save-git-config %}
![Save button in Git configuration field](/assets/images/help/desktop/windows-save-git-config.png)

{% 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 %}

{% 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.local-config-email %}
{% 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.local-config-email %}
{% 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 "[About the default branch](/github/collaborating-with-issues-and-pull-requests/about-branches#about-the-default-branch)."

{% mac %}

{% data reusables.desktop.mac-select-desktop-menu %}
1. In the Preferences window, click **Git**.
![The Git Pane in the Preferences menu](/assets/images/help/desktop/mac-select-git-pane.png)
1. 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...".
![Default branch name selection options](/assets/images/help/desktop/mac-select-default-branch-name.png)
{% data reusables.desktop.click-save-git-config %}
![Save button in Git configuration field](/assets/images/help/desktop/repository-settings-git-config-save.png)

{% endmac %}

{% windows %}

{% data reusables.desktop.windows-choose-options %}
1. In the Options window, click **Git**.
![The Git Pane in the Options menu](/assets/images/help/desktop/windows-select-git-pane.png)
1. 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.
![Default branch name selection options](/assets/images/help/desktop/windows-select-default-branch-name.png)
{% data reusables.desktop.click-save-git-config %}
![Save button in Git configuration field](/assets/images/help/desktop/repository-settings-git-config-save.png)

{% endwindows %}

## Further reading

- "[Adding an email address to your GitHub account](/articles/adding-an-email-address-to-your-github-account/)"
- "[Setting your commit email address](/articles/setting-your-commit-email-address/)"
- "[About branches](/github/collaborating-with-issues-and-pull-requests/about-branches)"
2 changes: 2 additions & 0 deletions data/reusables/desktop/local-config-email.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1. Under **Email**, select the dropdown menu and click the email you'd like to use for your local Git configuration.
![The name field of the local Git configuration](/assets/images/help/desktop/local-config-email.png)
2 changes: 2 additions & 0 deletions data/reusables/desktop/local-config-name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1. Under **Name**, type the name you'd like to use for your local Git configuration.
![The name field of the local Git configuration](/assets/images/help/desktop/local-config-name.png)
2 changes: 2 additions & 0 deletions data/reusables/desktop/mac-repository-settings-menu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1. In the **Repository** menu, click **Repository Settings...**.
![Repository Settings menu option](/assets/images/help/desktop/repository-settings-mac.png)
1 change: 0 additions & 1 deletion data/reusables/desktop/paste-email-git-config.md

This file was deleted.

2 changes: 2 additions & 0 deletions data/reusables/desktop/repository-settings-save.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1. Click **Save**.
![The Save button](/assets/images/help/desktop/repository-settings-save.png)
1 change: 1 addition & 0 deletions data/reusables/desktop/select-email-git-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1. Select the **Email** dropdown and click the email address you would like to use for your commits.
2 changes: 2 additions & 0 deletions data/reusables/desktop/select-git-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1. Click **Git Config**.
![Git Config option](/assets/images/help/desktop/select-git-config.png)
2 changes: 2 additions & 0 deletions data/reusables/desktop/use-local-git-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1. Under "For this repository I wish to", select **Use a local Git config**.
![Primary remote repository field](/assets/images/help/desktop/use-local-git-config.png)
2 changes: 2 additions & 0 deletions data/reusables/desktop/windows-repository-settings-menu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1. In the **Repository** menu, click **Repository settings...**.
![Repository settings menu option](/assets/images/help/desktop/repository-settings-win.png)

0 comments on commit c1c5fda

Please sign in to comment.