Skip to content

Commit c1c5fda

Browse files
authored
Merge pull request #18146 from github/desktop-configuring-git
Update "Configuring Git for GitHub Desktop" article
2 parents 52bb200 + 6fe6fe7 commit c1c5fda

26 files changed

+96
-30
lines changed
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

content/desktop/contributing-and-collaborating-using-github-desktop/working-with-your-remote-repository-on-github-or-github-enterprise/changing-a-remotes-url-from-github-desktop.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,18 @@ shortTitle: Change a remote's URL
1111
---
1212
{% mac %}
1313

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

2119
{% endmac %}
2220

2321
{% windows %}
2422

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

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

13-
{% data reusables.desktop.update-email-address %}
13+
{% 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.
14+
15+
{% 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.
16+
17+
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.
18+
19+
{% 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.
1420

1521
{% tip %}
1622

1723
**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/)."
1824

1925
{% endtip %}
2026

27+
## Configuring your global author information
28+
29+
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 %}.
30+
2131
{% mac %}
2232

23-
{% data reusables.desktop.sign-in-choose-product %}
24-
{% data reusables.user-settings.access_settings %}
25-
{% data reusables.user-settings.emails %}
26-
{% data reusables.desktop.copy-email-git-config %}
27-
{% data reusables.desktop.return-to-desktop %}
2833
{% data reusables.desktop.mac-select-desktop-menu %}
2934
7. In the Preferences window, click **Git**.
3035
![The Git Pane in the Preferences menu](/assets/images/help/desktop/mac-select-git-pane.png)
3136
{% data reusables.desktop.name-field-git-config %}
3237
![The name field of the Git configuration](/assets/images/help/desktop/mac-name-git-config.png)
33-
{% data reusables.desktop.paste-email-git-config %}
34-
![Pasted email address in Git configuration field](/assets/images/help/desktop/mac-email-git-config.png)
38+
{% data reusables.desktop.select-email-git-config %}
39+
![Select email address in Git configuration field](/assets/images/help/desktop/mac-email-git-config.png)
3540
{% data reusables.desktop.click-save-git-config %}
3641
![Save button in Git configuration field](/assets/images/help/desktop/mac-save-git-config.png)
3742

3843
{% endmac %}
3944

4045
{% windows %}
4146

42-
{% data reusables.desktop.sign-in-choose-product %}
43-
{% data reusables.user-settings.access_settings %}
44-
{% data reusables.user-settings.emails %}
45-
{% data reusables.desktop.copy-email-git-config %}
46-
{% data reusables.desktop.return-to-desktop %}
4747
{% data reusables.desktop.windows-choose-options %}
4848
8. In the Options window, click **Git**.
4949
![The Git Pane in the Options menu](/assets/images/help/desktop/windows-select-git-pane.png)
5050
{% data reusables.desktop.name-field-git-config %}
5151
![The name field of the Git configuration](/assets/images/help/desktop/windows-name-git-config.png)
52-
{% data reusables.desktop.paste-email-git-config %}
53-
![Pasted email address in Git configuration field](/assets/images/help/desktop/windows-email-git-config.png)
52+
{% data reusables.desktop.select-email-git-config %}
53+
![Select email address in Git configuration field](/assets/images/help/desktop/windows-email-git-config.png)
5454
{% data reusables.desktop.click-save-git-config %}
5555
![Save button in Git configuration field](/assets/images/help/desktop/windows-save-git-config.png)
5656

5757
{% endwindows %}
5858

59+
## Configuring different author information for an individual repository
60+
61+
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.
62+
63+
{% mac %}
64+
65+
{% data reusables.desktop.mac-repository-settings-menu %}
66+
{% data reusables.desktop.select-git-config %}
67+
{% data reusables.desktop.use-local-git-config %}
68+
{% data reusables.desktop.local-config-name %}
69+
{% data reusables.desktop.local-config-email %}
70+
{% data reusables.desktop.repository-settings-save %}
71+
72+
{% endmac %}
73+
74+
{% windows %}
75+
76+
{% data reusables.desktop.windows-repository-settings-menu %}
77+
{% data reusables.desktop.select-git-config %}
78+
{% data reusables.desktop.use-local-git-config %}
79+
{% data reusables.desktop.local-config-name %}
80+
{% data reusables.desktop.local-config-email %}
81+
{% data reusables.desktop.repository-settings-save %}
82+
83+
{% endwindows %}
84+
85+
86+
## Configuring your default branch for new repositories
87+
88+
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)."
89+
90+
{% mac %}
91+
92+
{% data reusables.desktop.mac-select-desktop-menu %}
93+
1. In the Preferences window, click **Git**.
94+
![The Git Pane in the Preferences menu](/assets/images/help/desktop/mac-select-git-pane.png)
95+
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...".
96+
![Default branch name selection options](/assets/images/help/desktop/mac-select-default-branch-name.png)
97+
{% data reusables.desktop.click-save-git-config %}
98+
![Save button in Git configuration field](/assets/images/help/desktop/repository-settings-git-config-save.png)
99+
100+
{% endmac %}
101+
102+
{% windows %}
103+
104+
{% data reusables.desktop.windows-choose-options %}
105+
1. In the Options window, click **Git**.
106+
![The Git Pane in the Options menu](/assets/images/help/desktop/windows-select-git-pane.png)
107+
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.
108+
![Default branch name selection options](/assets/images/help/desktop/windows-select-default-branch-name.png)
109+
{% data reusables.desktop.click-save-git-config %}
110+
![Save button in Git configuration field](/assets/images/help/desktop/repository-settings-git-config-save.png)
111+
112+
{% endwindows %}
113+
59114
## Further reading
60115

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

data/reusables/desktop/paste-email-git-config.md

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

0 commit comments

Comments
 (0)