1
0
mirror of synced 2025-12-23 21:07:12 -05:00

Update repository names to be consistent (#24121)

This commit is contained in:
Adam Crews
2023-03-09 04:23:10 -08:00
committed by GitHub
parent 9f3d465ec2
commit 0727a6be38

View File

@@ -31,18 +31,18 @@ To add a new remote, use the `git remote add` command on the terminal, in the di
The `git remote add` command takes two arguments:
* A remote name, for example, `origin`
* A remote URL, for example, `https://{% data variables.command_line.backticks %}/user/repo.git`
* A remote URL, for example, `https://{% data variables.command_line.backticks %}/OWNER/REPOSITORY.git`
For example:
```shell
$ git remote add origin https://{% data variables.command_line.codeblock %}/USER/REPO.git
$ git remote add origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git
# Set a new remote
$ git remote -v
# Verify new remote
> origin https://{% data variables.command_line.codeblock %}/USER/REPO.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/USER/REPO.git (push)
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push)
```
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:
* A new URL for the remote. For example:
* If you're updating to use HTTPS, your URL might look like:
```shell
https://{% data variables.command_line.backticks %}/USERNAME/REPOSITORY.git
https://{% data variables.command_line.backticks %}/OWNER/REPOSITORY.git
```
* If you're updating to use SSH, your URL might look like:
```shell
git@{% data variables.command_line.codeblock %}:USERNAME/REPOSITORY.git
git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git
```
### Switching remote URLs from SSH to HTTPS
@@ -91,19 +91,19 @@ git@{% data variables.command_line.codeblock %}:USERNAME/REPOSITORY.git
3. List your existing remotes in order to get the name of the remote you want to change.
```shell
$ git remote -v
> origin git@{% data variables.command_line.codeblock %}:USERNAME/REPOSITORY.git (fetch)
> origin git@{% data variables.command_line.codeblock %}:USERNAME/REPOSITORY.git (push)
> origin git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git (fetch)
> origin git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git (push)
```
4. Change your remote's URL from SSH to HTTPS with the `git remote set-url` command.
```shell
$ git remote set-url origin https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git
$ git remote set-url origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git
```
5. Verify that the remote URL has changed.
```shell
$ git remote -v
# Verify new remote URL
> origin https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git (push)
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push)
```
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-
3. List your existing remotes in order to get the name of the remote you want to change.
```shell
$ git remote -v
> origin https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/USERNAME/REPOSITORY.git (push)
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/OWNER/REPOSITORY.git (push)
```
4. Change your remote's URL from HTTPS to SSH with the `git remote set-url` command.
```shell
$ git remote set-url origin git@{% data variables.command_line.codeblock %}:USERNAME/REPOSITORY.git
$ git remote set-url origin git@{% data variables.command_line.codeblock %}:OWNER/REPOSITORY.git
```
5. Verify that the remote URL has changed.
```shell
$ git remote -v
# Verify new remote URL
> origin git@{% data variables.command_line.codeblock %}: USERNAME/REPOSITORY.git (fetch)
> origin git@{% data variables.command_line.codeblock %}: USERNAME/REPOSITORY.git (push)
> origin git@{% data variables.command_line.codeblock %}: OWNER/REPOSITORY.git (fetch)
> origin git@{% data variables.command_line.codeblock %}: OWNER/REPOSITORY.git (push)
```
### Troubleshooting: No such remote '[name]'