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:
Siddharth Kannan 2017-12-18 19:33:33 +05:30 committed by Richard Littauer
parent da6f0f8e66
commit da44b4d6c1
1 changed files with 19 additions and 1 deletions

View File

@ -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 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 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)
- [Rebasing and Merging](#rebasing-and-merging)
- [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)
- [Finding](#finding)
- [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)
- [Clone all submodules](#clone-all-submodules)
- [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.
<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>
### I want to set my HEAD to track the default remote branch