mirror of https://github.com/namibia/tips.git
Changing a remote's URL
This commit is contained in:
parent
979fe1c80d
commit
04573ea87d
16
README.md
16
README.md
|
@ -14,6 +14,8 @@
|
|||
* [Track upstream branch](https://github.com/git-tips/tips#Track-upstream-branch)
|
||||
* [Delete local branch](https://github.com/git-tips/tips#Delete-local-branch)
|
||||
* [Delete remote branch](https://github.com/git-tips/tips#Delete-remote-branch)
|
||||
* [Undo local changes with the last content in head](https://github.com/git-tips/tips#Undo-local-changes-with-the-last-content-in-head)
|
||||
* [Changing a remote's URL](https://github.com/git-tips/tips#Changing-a-remotes-URL)
|
||||
|
||||
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
|
||||
<!-- @doxie.inject end toc -->
|
||||
|
@ -68,12 +70,22 @@ git branch -u origin/mybranch
|
|||
|
||||
## Delete local branch
|
||||
```sh
|
||||
git branch -d local_branchname
|
||||
git branch -d <local_branchname>
|
||||
```
|
||||
|
||||
## Delete remote branch
|
||||
```sh
|
||||
git push origin :remote_branchname
|
||||
git push origin :<remote_branchname>
|
||||
```
|
||||
|
||||
## Undo local changes with the last content in head
|
||||
```sh
|
||||
git checkout -- <file_name>
|
||||
```
|
||||
|
||||
## Changing a remote's URL
|
||||
```sh
|
||||
git remote set-url origin <URL>
|
||||
```
|
||||
|
||||
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
|
||||
|
|
10
tips.json
10
tips.json
|
@ -37,14 +37,18 @@
|
|||
},
|
||||
{
|
||||
"title": "Delete local branch",
|
||||
"tip": "git branch -d local_branchname"
|
||||
"tip": "git branch -d <local_branchname>"
|
||||
},
|
||||
{
|
||||
"title": "Delete remote branch",
|
||||
"tip": "git push origin :remote_branchname"
|
||||
"tip": "git push origin :<remote_branchname>"
|
||||
},
|
||||
{
|
||||
"title": "Undo local changes with the last content in head",
|
||||
"tip": "git checkout -- file_name"
|
||||
"tip": "git checkout -- <file_name>"
|
||||
},
|
||||
{
|
||||
"title": "Changing a remote's URL",
|
||||
"tip": "git remote set-url origin <URL>"
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue