1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00

Add Rename A Remote as a git til

This commit is contained in:
jbranchaud
2017-06-07 22:12:16 -05:00
parent 7ddf06f356
commit 3d6cfe3e89
2 changed files with 24 additions and 1 deletions

View File

@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
For a steady stream of TILs from a variety of rocketeers, checkout
[til.hashrocket.com](https://til.hashrocket.com/).
_538 TILs and counting..._
_539 TILs and counting..._
---
@@ -166,6 +166,7 @@ _538 TILs and counting..._
- [List Untracked Files](git/list-untracked-files.md)
- [Move The Latest Commit To A New Branch](git/move-the-latest-commit-to-a-new-branch.md)
- [Reference A Commit Via Commit Message Pattern Matching](git/reference-a-commit-via-commit-message-pattern-matching.md)
- [Rename A Remote](git/rename-a-remote.md)
- [Renaming A Branch](git/renaming-a-branch.md)
- [Resetting A Reset](git/resetting-a-reset.md)
- [Show All Commits For A File Beyond Renaming](git/show-all-commits-for-a-file-beyond-renaming.md)

22
git/rename-a-remote.md Normal file
View File

@@ -0,0 +1,22 @@
# Rename A Remote
If you just added a remote (`git remote add ...`) and messed up the name or
just need to rename some existing remote, you can do so with the `rename`
command.
First, let's see the remotes we have:
```bash
$ git remote -v
origin https://github.com/jbranchaud/til.git (fetch)
origin https://github.com/jbranchaud/til.git (push)
```
To then rename `origin` to `destination`, for example, we can issue the
following command:
```bash
$ git remote rename origin destination
```
See `man git-remote` for more details.