diff options
Diffstat (limited to 'Documentation/git-branch.txt')
-rw-r--r-- | Documentation/git-branch.txt | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 0e836809c2..60fa684b1d 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -11,7 +11,7 @@ SYNOPSIS 'git branch' [--color | --no-color] [-r | -a] [-v [--abbrev=<length> | --no-abbrev]] [(--merged | --no-merged | --contains) [<commit>]] -'git branch' [--track | --no-track] [-l] [-f] <branchname> [<start-point>] +'git branch' [--set-upstream | --track | --no-track] [-l] [-f] <branchname> [<start-point>] 'git branch' (-m | -M) [<oldbranch>] <newbranch> 'git branch' (-d | -D) [-r] <branchname>... @@ -38,7 +38,7 @@ working tree to it; use "git checkout <newbranch>" to switch to the new branch. When a local branch is started off a remote branch, git sets up the -branch so that 'git-pull' will appropriately merge from +branch so that 'git pull' will appropriately merge from the remote branch. This behavior may be changed via the global `branch.autosetupmerge` configuration flag. That setting can be overridden by using the `--track` and `--no-track` options. @@ -55,7 +55,7 @@ has a reflog then the reflog will also be deleted. Use -r together with -d to delete remote-tracking branches. Note, that it only makes sense to delete remote-tracking branches if they no longer exist -in the remote repository or if 'git-fetch' was configured not to fetch +in the remote repository or if 'git fetch' was configured not to fetch them again. See also the 'prune' subcommand of linkgit:git-remote[1] for a way to clean up all obsolete remote-tracking branches. @@ -63,7 +63,9 @@ way to clean up all obsolete remote-tracking branches. OPTIONS ------- -d:: - Delete a branch. The branch must be fully merged in HEAD. + Delete a branch. The branch must be fully merged in its + upstream branch, or in `HEAD` if no upstream was set with + `--track` or `--set-upstream`. -D:: Delete a branch irrespective of its merged status. @@ -72,11 +74,13 @@ OPTIONS Create the branch's reflog. This activates recording of all changes made to the branch ref, enabling use of date based sha1 expressions such as "<branchname>@\{yesterday}". + Note that in non-bare repositories, reflogs are usually + enabled by default by the `core.logallrefupdates` config option. -f:: --force:: Reset <branchname> to <startpoint> if <branchname> exists - already. Without `-f` 'git-branch' refuses to change an existing branch. + already. Without `-f` 'git branch' refuses to change an existing branch. -m:: Move/rename a branch and the corresponding reflog. @@ -129,6 +133,12 @@ start-point is either a local or remote branch. Do not set up "upstream" configuration, even if the branch.autosetupmerge configuration variable is true. +--set-upstream:: + If specified branch does not exist yet or if '--force' has been + given, acts exactly like '--track'. Otherwise sets up configuration + like '--track' would when creating the branch, except that where + branch points to is not changed. + --contains <commit>:: Only list branches which contain the specified commit. |