1
0
mirror of synced 2026-01-01 00:04:41 -05:00
Files
docs/translations/ru-RU/content/github/using-git/renaming-a-remote.md
Chiedo John c116efe725 Crowdin translations (translation-batch-1604415979) (#16312)
* New Crowdin translations by Github Action

* Revert broken translated files to English

* Revert broken translations

* Revert broken translations

* Revert more broket translations

* Revert broken translation

* Increase Node memory limit for running Jest

* Allow Node to use more memory for Jest

* Increase Node memory limit for running Jest

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Chiedo <chiedo@users.noreply.github.com>
Co-authored-by: James M. Greene <JamesMGreene@github.com>
2020-11-03 16:15:55 -05:00

2.1 KiB

title, intro, redirect_from, versions
title intro redirect_from versions
Renaming a remote Use the `git remote rename` command to rename an existing remote.
/articles/renaming-a-remote
free-pro-team enterprise-server github-ae
* * *

The git remote rename command takes two arguments:

  • An existing remote name, for example, origin
  • A new name for the remote, for example, destination

Пример

These examples assume you're cloning using HTTPS, which is recommended.

$ git remote -v
# View existing remotes
> origin  https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (fetch)
> origin  https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (push)

$ git remote rename origin destination
# Change remote name from 'origin' to 'destination'

$ git remote -v
# Verify remote's new name
> destination  https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (fetch)
> destination  https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (push)

Устранение проблем

You may encounter these errors when trying to rename a remote.

Could not rename config section 'remote.[old name]' to 'remote.[new name]'

This error means that the remote you tried the old remote name you typed doesn't exist.

You can check which remotes currently exist with the git remote -v command:

$ git remote -v
# View existing remotes
> origin  https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (fetch)
> origin  https://{% data variables.command_line.codeblock %}/<em>OWNER</em>/<em>REPOSITORY</em>.git (push)

Remote [new name] already exists.

This error means that the remote name you want to use already exists. To solve this, either use a different remote name, or rename the original remote.

Дополнительная литература