diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-05-05 19:16:06 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-05-05 19:16:06 -0700 |
commit | b79c9859c8eb3bb4390f91320e126199ff884907 (patch) | |
tree | ecb36c8abbef20850f0c05e4ac003004d1b50b44 /Documentation | |
parent | Merge branch 'pb/remote-mirror-config' (diff) | |
parent | Add tests for `branch --[no-]merged` (diff) | |
download | tgif-b79c9859c8eb3bb4390f91320e126199ff884907.tar.xz |
Merge branch 'lh/branch-merged'
* lh/branch-merged:
Add tests for `branch --[no-]merged`
git-branch.txt: compare --contains, --merged and --no-merged
git-branch: add support for --merged and --no-merged
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-branch.txt | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 6f07a17a2c..c824d88742 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=<length> | --no-abbrev]] [--contains <commit>] 'git-branch' [--track | --no-track] [-l] [-f] <branchname> [<start-point>] @@ -24,6 +24,8 @@ and option `-a` shows both. With `--contains <commit>`, 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 <branchname> will be created. It will start out with a head equal to the one given as <start-point>. @@ -118,6 +120,15 @@ OPTIONS --no-track:: Ignore the branch.autosetupmerge configuration variable. +--contains <commit>:: + 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. + <branchname>:: The name of the branch to create or delete. The new branch name must pass all checks defined by @@ -175,6 +186,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 <commit>` is used to find all branches which will need + special attention if <commit> were to be rebased or amended, since those + branches contain the specified <commit>. + +- `--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 ------ |