Renaming a Remote
suggest changeTo rename remote, use command git remote rename
The git remote rename
command takes two arguments:
- An existing remote name, for example : origin
- A new name for the remote, for example : destination
Get existing remote name
git remote
# origin
Check existing remote with URL
git remote -v
# origin https://github.com/username/repo.git (fetch)
# origin https://github.com/usernam/repo.git (push)
Rename remote
git remote rename origin destination
# Change remote name from 'origin' to 'destination'
Verify new name
git remote -v
# destination https://github.com/username/repo.git (fetch)
# destination https://github.com/usernam/repo.git (push)
=== Posible Errors ===
- Could not rename config section ‘remote.[old name]’ to ‘remote.[new name]’
This error means that the remote you tried the old remote name (origin) doesn’t exist.
- Remote [new name] already exists.
Error message is self explanatory.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents