mirror of
https://github.com/k88hudson/git-flight-rules.git
synced 2025-03-10 12:48:43 -03:00
add the usage information for for git-branch --set-upstream-to (#176)
* add application for git-branch --set-upstream-to * run doctoc - typo in one line for the TOC * put note in bash comment
This commit is contained in:
parent
da6f0f8e66
commit
da44b4d6c1
20
README.md
20
README.md
@ -58,6 +58,7 @@ For clarity's sake all examples in this document use a customized bash prompt in
|
|||||||
- [I want to rename a branch](#i-want-to-rename-a-branch)
|
- [I want to rename a branch](#i-want-to-rename-a-branch)
|
||||||
- [I want to checkout to a remote branch that someone else is working on](#i-want-to-checkout-to-a-remote-branch-that-someone-else-is-working-on)
|
- [I want to checkout to a remote branch that someone else is working on](#i-want-to-checkout-to-a-remote-branch-that-someone-else-is-working-on)
|
||||||
- [I want to create a new remote branch from current local one](#i-want-to-create-a-new-remote-branch-from-current-local-one)
|
- [I want to create a new remote branch from current local one](#i-want-to-create-a-new-remote-branch-from-current-local-one)
|
||||||
|
- [I want to set a remote branch as the upstream for a local branch](#i-want-to-set-a-remote-branch-as-the-upstream-for-a-local-branch)
|
||||||
- [I want to set my HEAD to track the default remote branch](#i-want-to-set-my-head-to-track-the-default-remote-branch)
|
- [I want to set my HEAD to track the default remote branch](#i-want-to-set-my-head-to-track-the-default-remote-branch)
|
||||||
- [Rebasing and Merging](#rebasing-and-merging)
|
- [Rebasing and Merging](#rebasing-and-merging)
|
||||||
- [I want to undo rebase/merge](#i-want-to-undo-rebasemerge)
|
- [I want to undo rebase/merge](#i-want-to-undo-rebasemerge)
|
||||||
@ -78,7 +79,7 @@ For clarity's sake all examples in this document use a customized bash prompt in
|
|||||||
- [Apply a specific stash from list](#apply-a-specific-stash-from-list)
|
- [Apply a specific stash from list](#apply-a-specific-stash-from-list)
|
||||||
- [Finding](#finding)
|
- [Finding](#finding)
|
||||||
- [I want to find a string in any commit](#i-want-to-find-a-string-in-any-commit)
|
- [I want to find a string in any commit](#i-want-to-find-a-string-in-any-commit)
|
||||||
- [I want to find by author/committer](#i-want-to-find-by-author-committer)
|
- [I want to find by author/committer](#i-want-to-find-by-authorcommitter)
|
||||||
- [Miscellaneous Objects](#miscellaneous-objects)
|
- [Miscellaneous Objects](#miscellaneous-objects)
|
||||||
- [Clone all submodules](#clone-all-submodules)
|
- [Clone all submodules](#clone-all-submodules)
|
||||||
- [Remove a submodule](#remove-a-submodule)
|
- [Remove a submodule](#remove-a-submodule)
|
||||||
@ -789,6 +790,23 @@ $ git push
|
|||||||
|
|
||||||
The behavior of the other modes of ```git push``` is described in the doc of push.default.
|
The behavior of the other modes of ```git push``` is described in the doc of push.default.
|
||||||
|
|
||||||
|
<a name="i-want-to-set-a-remote-branch-as-the-upstream-for-a-local-branch"></a>
|
||||||
|
### I want to set a remote branch as the upstream for a local branch
|
||||||
|
|
||||||
|
You can set a remote branch as the upstream for the current local branch using:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ git branch --set-upstream-to [remotename]/[branch]
|
||||||
|
# or, using the shorthand:
|
||||||
|
$ git branch -u [remotename]/[branch]
|
||||||
|
```
|
||||||
|
|
||||||
|
To set the upstream remote branch for another local branch:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ git branch -u [remotename]/[branch] [local-branch]
|
||||||
|
```
|
||||||
|
|
||||||
<a name="i-want-to-set-my-HEAD-to-track-the-default-remote-branch"></a>
|
<a name="i-want-to-set-my-HEAD-to-track-the-default-remote-branch"></a>
|
||||||
### I want to set my HEAD to track the default remote branch
|
### I want to set my HEAD to track the default remote branch
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user