Skip to content

Commit 04573ea

Browse files
committed
Changing a remote's URL
1 parent 979fe1c commit 04573ea

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* [Track upstream branch](https://github.com/git-tips/tips#Track-upstream-branch)
1515
* [Delete local branch](https://github.com/git-tips/tips#Delete-local-branch)
1616
* [Delete remote branch](https://github.com/git-tips/tips#Delete-remote-branch)
17+
* [Undo local changes with the last content in head](https://github.com/git-tips/tips#Undo-local-changes-with-the-last-content-in-head)
18+
* [Changing a remote's URL](https://github.com/git-tips/tips#Changing-a-remotes-URL)
1719

1820
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
1921
<!-- @doxie.inject end toc -->
@@ -68,12 +70,22 @@ git branch -u origin/mybranch
6870

6971
## Delete local branch
7072
```sh
71-
git branch -d local_branchname
73+
git branch -d <local_branchname>
7274
```
7375

7476
## Delete remote branch
7577
```sh
76-
git push origin :remote_branchname
78+
git push origin :<remote_branchname>
79+
```
80+
81+
## Undo local changes with the last content in head
82+
```sh
83+
git checkout -- <file_name>
84+
```
85+
86+
## Changing a remote's URL
87+
```sh
88+
git remote set-url origin <URL>
7789
```
7890

7991
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->

tips.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,18 @@
3737
},
3838
{
3939
"title": "Delete local branch",
40-
"tip": "git branch -d local_branchname"
40+
"tip": "git branch -d <local_branchname>"
4141
},
4242
{
4343
"title": "Delete remote branch",
44-
"tip": "git push origin :remote_branchname"
44+
"tip": "git push origin :<remote_branchname>"
4545
},
4646
{
4747
"title": "Undo local changes with the last content in head",
48-
"tip": "git checkout -- file_name"
48+
"tip": "git checkout -- <file_name>"
49+
},
50+
{
51+
"title": "Changing a remote's URL",
52+
"tip": "git remote set-url origin <URL>"
4953
}
5054
]

0 commit comments

Comments
 (0)