Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update "Configuring Git for GitHub Desktop" article #18146

Merged
merged 25 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e9ca776
Remove steps that are no longer needed
steveward May 12, 2022
691f8e8
Rename reusable and update
steveward May 12, 2022
717d0ba
Update and add screenshots
steveward May 17, 2022
813ea07
Get started on updating configuring Git details
steveward May 13, 2022
567c6ff
Fix image links
steveward May 24, 2022
92021c0
Merge branch 'main' into desktop-configuring-git
steveward May 24, 2022
6478d47
Add reusables and screenshots for local repository config
steveward May 24, 2022
dd655cf
Update changing remote article with new screenshots and reusables
steveward May 24, 2022
953b64d
Merge branch 'desktop-configuring-git' of https://github.com/github/d…
steveward May 24, 2022
15fa901
Add missing screenshots
steveward May 24, 2022
a2c1c64
Specify local vs global
steveward May 24, 2022
f1e8abf
Move images to correct dir
steveward May 24, 2022
70b031c
Update configuring-git-for-github-desktop.md
steveward May 24, 2022
b5c8055
Update wording in intro and about
steveward May 26, 2022
960e67b
Merge branch 'main' into desktop-configuring-git
steveward May 26, 2022
4d88a1d
Fix screenshot
steveward May 26, 2022
6a495b8
Merge branch 'desktop-configuring-git' of https://github.com/github/d…
steveward May 26, 2022
0512a6c
Add suggestions from review
steveward Jun 2, 2022
48d4f18
Add suggested paragraph and intro sentence
steveward Jun 2, 2022
5a05511
Merge branch 'main' into desktop-configuring-git
steveward Jun 2, 2022
089e0d6
Update content/desktop/contributing-and-collaborating-using-github-de…
steveward Jun 3, 2022
b1cc5fc
Update content/desktop/installing-and-configuring-github-desktop/conf…
steveward Jun 3, 2022
7603c35
Merge branch 'main' into desktop-configuring-git
steveward Jun 3, 2022
032946d
Merge branch 'main' into desktop-configuring-git
steveward Jun 3, 2022
6fe6fe7
Merge branch 'main' into desktop-configuring-git
lecoursen Jun 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 %}

steveward marked this conversation as resolved.
Show resolved Hide resolved
{% 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 %}.

steveward marked this conversation as resolved.
Show resolved Hide resolved
{% 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)