You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/get-started/getting-started-with-git/managing-remote-repositories.md
+16-16
Original file line number
Diff line number
Diff line change
@@ -31,18 +31,18 @@ To add a new remote, use the `git remote add` command on the terminal, in the di
31
31
32
32
The `git remote add` command takes two arguments:
33
33
* A remote name, for example, `origin`
34
-
* A remote URL, for example, `https://{% data variables.command_line.backticks %}/user/repo.git`
34
+
* A remote URL, for example, `https://{% data variables.command_line.backticks %}/OWNER/REPOSITORY.git`
35
35
36
36
For example:
37
37
38
38
```shell
39
-
$ git remote add origin https://{% data variables.command_line.codeblock %}/USER/REPO.git
39
+
$ git remote add origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git
40
40
# Set a new remote
41
41
42
42
$ git remote -v
43
43
# Verify new remote
44
-
> origin https://{% data variables.command_line.codeblock %}/USER/REPO.git (fetch)
45
-
> origin https://{% data variables.command_line.codeblock %}/USER/REPO.git (push)
44
+
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch)
45
+
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push)
46
46
```
47
47
48
48
For more information on which URL to use, see "[AUTOTITLE](/get-started/getting-started-with-git/about-remote-repositories)."
@@ -77,11 +77,11 @@ The `git remote set-url` command takes two arguments:
77
77
* A new URL for the remote. For example:
78
78
* If you're updating to use HTTPS, your URL might look like:
79
79
```shell
80
-
https://{% data variables.command_line.backticks %}/USERNAME/REPOSITORY.git
80
+
https://{% data variables.command_line.backticks %}/OWNER/REPOSITORY.git
81
81
```
82
82
* If you're updating to use SSH, your URL might look like:
83
83
```shell
84
-
git@{% data variables.command_line.codeblock %}:USERNAME/REPOSITORY.git
84
+
git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git
85
85
```
86
86
87
87
### Switching remote URLs from SSH to HTTPS
@@ -91,19 +91,19 @@ git@{% data variables.command_line.codeblock %}:USERNAME/REPOSITORY.git
91
91
3. List your existing remotes in order to get the name of the remote you want to change.
92
92
```shell
93
93
$ git remote -v
94
-
> origin git@{% data variables.command_line.codeblock %}:USERNAME/REPOSITORY.git (fetch)
95
-
> origin git@{% data variables.command_line.codeblock %}:USERNAME/REPOSITORY.git (push)
94
+
> origin git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git (fetch)
95
+
> origin git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git (push)
96
96
```
97
97
4. Change your remote's URL from SSH to HTTPS with the `git remote set-url` command.
98
98
```shell
99
-
$ git remote set-url origin https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git
99
+
$ git remote set-url origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git
100
100
```
101
101
5. Verify that the remote URL has changed.
102
102
```shell
103
103
$ git remote -v
104
104
# Verify new remote URL
105
-
> origin https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git (fetch)
106
-
> origin https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git (push)
105
+
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch)
106
+
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push)
107
107
```
108
108
109
109
The next time you `git fetch`, `git pull`, or `git push` to the remote repository, you'll be asked for your GitHub username and password. {% data reusables.user-settings.password-authentication-deprecation %}
@@ -117,19 +117,19 @@ You can [use a credential helper](/get-started/getting-started-with-git/caching-
117
117
3. List your existing remotes in order to get the name of the remote you want to change.
118
118
```shell
119
119
$ git remote -v
120
-
> origin https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git (fetch)
121
-
> origin https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git (push)
120
+
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch)
121
+
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push)
122
122
```
123
123
4. Change your remote's URL from HTTPS to SSH with the `git remote set-url` command.
124
124
```shell
125
-
$ git remote set-url origin git@{% data variables.command_line.codeblock %}:USERNAME/REPOSITORY.git
125
+
$ git remote set-url origin git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git
126
126
```
127
127
5. Verify that the remote URL has changed.
128
128
```shell
129
129
$ git remote -v
130
130
# Verify new remote URL
131
-
> origin git@{% data variables.command_line.codeblock %}: USERNAME/REPOSITORY.git (fetch)
132
-
> origin git@{% data variables.command_line.codeblock %}: USERNAME/REPOSITORY.git (push)
131
+
> origin git@{% data variables.command_line.codeblock %}: OWNER/REPOSITORY.git (fetch)
132
+
> origin git@{% data variables.command_line.codeblock %}: OWNER/REPOSITORY.git (push)
0 commit comments