Skip to content

Commit 3d6cfe3

Browse files
committedJun 8, 2017
Add Rename A Remote as a git til
1 parent 7ddf06f commit 3d6cfe3

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed
 

‎README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
1010
For 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)

‎git/rename-a-remote.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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.

0 commit comments

Comments
 (0)
Please sign in to comment.