File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -97,9 +97,23 @@ or by running `git credential-manager github --help`.
97
97
98
98
## TL;DR: Tell GCM to remember which account to use
99
99
100
- The easiest way to have GCM remember which account to use for which repository
101
- is to include the account name in the remote URL. If you're using HTTPS remotes,
102
- you can include the account name in the URL by inserting it before the ` @ ` sign
100
+ To set a default account for a particular remote you can simply set the
101
+ following Git configuration:
102
+
103
+ ``` shell
104
+ git config --global credential.< URL> .username < USERNAME>
105
+ ```
106
+
107
+ ..where ` <URL> ` is the remote URL and ` <USERNAME> ` is the account you wish to
108
+ have as the default. For example, for ` github.com ` and the user ` alice ` :
109
+
110
+ ``` shell
111
+ git config --global credential.https://github.com.username alice
112
+ ```
113
+
114
+ If you wish to set a user for a specific repository or remote URL, you can
115
+ include the account name in the remote URL. If you're using HTTPS remotes, you
116
+ can include the account name in the URL by inserting it before the ` @ ` sign
103
117
in the domain name.
104
118
105
119
For example, if you want to always use the ` alice ` account for the ` mona/test `
You can’t perform that action at this time.
0 commit comments