Skip to content

Commit

Permalink
add the usage information for for git-branch --set-upstream-to (k88hu…
Browse files Browse the repository at this point in the history
…dson#176)

* add application for git-branch --set-upstream-to

* run doctoc - typo in one line for the TOC

* put note in bash comment
  • Loading branch information
icyflame authored and RichardLitt committed Dec 18, 2017
1 parent da6f0f8 commit da44b4d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit da44b4d

Please sign in to comment.