X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=Documentation%2Fgit-branch.txt;h=6f07a17a2c310a67f23034c520ab10670407c006;hb=15fc1c02fce2ee6a8a3f625bf24dd782fd905904;hp=7e8874acaacbd6990ccaf66d5bddbff6e4c1e5ba;hpb=860cc3a4f9c3ac21fcd37bbe30f40ab073f01299;p=git.git diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 7e8874aca..b3e62ed01 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -8,12 +8,12 @@ git-branch - List, create, or delete branches SYNOPSIS -------- [verse] -'git-branch' [--color | --no-color] [-r | -a] +'git branch' [--color | --no-color] [-r | -a] [--merged | --no-merged] [-v [--abbrev= | --no-abbrev]] [--contains ] -'git-branch' [--track | --no-track] [-l] [-f] [] -'git-branch' (-m | -M) [] -'git-branch' (-d | -D) [-r] ... +'git branch' [--track | --no-track] [-l] [-f] [] +'git branch' (-m | -M) [] +'git branch' (-d | -D) [-r] ... DESCRIPTION ----------- @@ -24,6 +24,8 @@ and option `-a` shows both. With `--contains `, shows only the branches that contains the named commit (in other words, the branches whose tip commits are descendant of the named commit). +With `--merged`, only branches merged into HEAD will be listed, and +with `--no-merged` only branches not merged into HEAD will be listed. In its second form, a new branch named will be created. It will start out with a head equal to the one given as . @@ -35,11 +37,10 @@ working tree to it; use "git checkout " to switch to the new branch. When a local branch is started off a remote branch, git sets up the -branch so that linkgit:git-pull[1] will appropriately merge from that -remote branch. If this behavior is not desired, it is possible to -disable it using the global `branch.autosetupmerge` configuration -flag. That setting can be overridden by using the `--track` -and `--no-track` options. +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. With a '-m' or '-M' option, will be renamed to . If had a corresponding reflog, it is renamed to match @@ -53,7 +54,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 remote repository or if linkgit:git-fetch[1] was configured not to fetch +in remote repository or if 'git-fetch' was configured not to fetch them again. See also 'prune' subcommand of linkgit:git-remote[1] for way to clean up all obsolete remote-tracking branches. @@ -94,7 +95,8 @@ OPTIONS -a:: List both remote-tracking branches and local branches. --v, --verbose:: +-v:: +--verbose:: Show sha1 and commit subject line for each head. --abbrev=:: @@ -105,20 +107,28 @@ OPTIONS Display the full sha1s in output listing rather than abbreviating them. --track:: - Set up configuration so that git-pull will automatically - retrieve data from the remote branch. Use this if you always - pull from the same remote branch into the new branch, or if you - don't want to use "git pull " explicitly. - This behavior is the default. Set the - branch.autosetupmerge configuration variable to false if you - want git-checkout and git-branch to always behave as if - '--no-track' were given. + When creating a new branch, set up configuration so that 'git-pull' + will automatically retrieve data from the start point, which must be + a branch. Use this if you always pull from the same upstream branch + into the new branch, and if you don't want to use "git pull + " explicitly. This behavior is the default + when the start point is a remote branch. Set the + branch.autosetupmerge configuration variable to `false` if you want + 'git-checkout' and 'git-branch' to always behave as if '--no-track' were + given. Set it to `always` if you want this behavior when the + start-point is either a local or remote branch. --no-track:: - When a branch is created off a remote branch, - set up configuration so that git-pull will not retrieve data - from the remote branch, ignoring the branch.autosetupmerge - configuration variable. + Ignore the branch.autosetupmerge configuration variable. + +--contains :: + Only list branches which contain the specified commit. + +--merged:: + Only list branches which are fully contained by HEAD. + +--no-merged:: + Do not list branches which are fully contained by HEAD. :: The name of the branch to create or delete. @@ -177,6 +187,18 @@ If you are creating a branch that you want to immediately checkout, it's easier to use the git checkout command with its `-b` option to create a branch and check it out with a single command. +The options `--contains`, `--merged` and `--no-merged` serves three related +but different purposes: + +- `--contains ` is used to find all branches which will need + special attention if were to be rebased or amended, since those + branches contain the specified . + +- `--merged` is used to find all branches which can be safely deleted, + since those branches are fully contained by HEAD. + +- `--no-merged` is used to find branches which are candidates for merging + into HEAD, since those branches are not fully contained by HEAD. Author ------ @@ -188,4 +210,4 @@ Documentation by Junio C Hamano and the git-list . GIT --- -Part of the linkgit:git[7] suite +Part of the linkgit:git[1] suite