1
0
mirror of synced 2026-01-01 09:04:46 -05:00
Files
docs/translations/ru-RU/content/github/using-git/adding-a-remote.md
Vanessa Yuen 01b5d89239 Crowdin translations (translation-batch-1610993249) (#17348)
* New Crowdin translations by Github Action

* Revert broken translated files to English

* fix mistranslated type

* fix mistranslated dates

* fix liquid operator

* revert broken to english

* revert broken translations to english

* revert broken translations to english

* fix broken liquid tag 😭

* fix tags

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
2021-01-19 20:12:46 +01:00

53 lines
1.7 KiB
Markdown

---
title: Adding a remote
intro: 'To add a new remote, use the `git remote add` command on the terminal, in the directory your repository is stored at.'
redirect_from:
- /articles/adding-a-remote
versions:
free-pro-team: '*'
enterprise-server: '*'
github-ae: '*'
---
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`
Например:
```shell
$ git remote add origin https://{% data variables.command_line.codeblock %}/<em>user</em>/<em>repo</em>.git
# Set a new remote
$ git remote -v
# Verify new remote
> origin https://{% data variables.command_line.codeblock %}/<em>user</em>/<em>repo</em>.git (fetch)
> origin https://{% data variables.command_line.codeblock %}/<em>user</em>/<em>repo</em>.git (push)
```
Not sure which URL to use? Check out "[Which remote URL should I use?](/articles/which-remote-url-should-i-use)"
### Устранение проблем
You may encounter these errors when trying to add a remote.
#### Remote `name` already exists
This error means you've tried to add a remote with a name that already exists in your local repository:
```shell
$ git remote add origin https://{% data variables.command_line.codeblock %}/octocat/Spoon-Knife.git
> fatal: remote origin already exists.
```
To fix this, you can
* Use a different name for the new remote
* [Rename the existing remote](/articles/renaming-a-remote)
* [Delete the existing remote](/articles/removing-a-remote)
### Дополнительная литература
- "[Working with Remotes" from the _Pro Git_ book](https://git-scm.com/book/en/Git-Basics-Working-with-Remotes)