File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
1010For a steady stream of TILs from a variety of rocketeers, checkout
1111[ til.hashrocket.com] ( https://til.hashrocket.com/ ) .
1212
13- _ 538 TILs and counting..._
13+ _ 539 TILs and counting..._
1414
1515---
1616
@@ -166,6 +166,7 @@ _538 TILs and counting..._
166166- [ List Untracked Files] ( git/list-untracked-files.md )
167167- [ Move The Latest Commit To A New Branch] ( git/move-the-latest-commit-to-a-new-branch.md )
168168- [ Reference A Commit Via Commit Message Pattern Matching] ( git/reference-a-commit-via-commit-message-pattern-matching.md )
169+ - [ Rename A Remote] ( git/rename-a-remote.md )
169170- [ Renaming A Branch] ( git/renaming-a-branch.md )
170171- [ Resetting A Reset] ( git/resetting-a-reset.md )
171172- [ Show All Commits For A File Beyond Renaming] ( git/show-all-commits-for-a-file-beyond-renaming.md )
Original file line number Diff line number Diff line change 1+ # Rename A Remote
2+
3+ If you just added a remote (` git remote add ... ` ) and messed up the name or
4+ just need to rename some existing remote, you can do so with the ` rename `
5+ command.
6+
7+ First, let's see the remotes we have:
8+
9+ ``` bash
10+ $ git remote -v
11+ origin https://github.com/jbranchaud/til.git (fetch)
12+ origin https://github.com/jbranchaud/til.git (push)
13+ ```
14+
15+ To then rename ` origin ` to ` destination ` , for example, we can issue the
16+ following command:
17+
18+ ``` bash
19+ $ git remote rename origin destination
20+ ```
21+
22+ See ` man git-remote ` for more details.
You can’t perform that action at this time.
0 commit comments