X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Fgit-branch.txt;h=0fd58083eb2afdb7fed7ebf01bab3b5e1cae1421;hb=c30e699fc509f43f459c17d3148e7d866fb9157a;hp=6f07a17a2c310a67f23034c520ab10670407c006;hpb=31c6390d40fe12a46c38d7224da61c6771886f2a;p=git.git diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 6f07a17a2..0fd58083e 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -8,7 +8,7 @@ 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] [] @@ -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 . @@ -93,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=:: @@ -118,6 +121,15 @@ OPTIONS --no-track:: 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. The new branch name must pass all checks defined by @@ -175,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 ------ @@ -186,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