Skip to content

Commit 9a7ea2b

Browse files
hjemligitster
authored andcommitted
git-branch.txt: compare --contains, --merged and --no-merged
Signed-off-by: Lars Hjemli <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e8b404c commit 9a7ea2b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Documentation/git-branch.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ OPTIONS
120120
--no-track::
121121
Ignore the branch.autosetupmerge configuration variable.
122122

123+
--contains <commit>::
124+
Only list branches which contain the specified commit.
125+
126+
--merged::
127+
Only list branches which are fully contained by HEAD.
128+
129+
--no-merged::
130+
Do not list branches which are fully contained by HEAD.
131+
123132
<branchname>::
124133
The name of the branch to create or delete.
125134
The new branch name must pass all checks defined by
@@ -177,6 +186,18 @@ If you are creating a branch that you want to immediately checkout, it's
177186
easier to use the git checkout command with its `-b` option to create
178187
a branch and check it out with a single command.
179188

189+
The options `--contains`, `--merged` and `--no-merged` serves three related
190+
but different purposes:
191+
192+
- `--contains <commit>` is used to find all branches which will need
193+
special attention if <commit> were to be rebased or amended, since those
194+
branches contain the specified <commit>.
195+
196+
- `--merged` is used to find all branches which can be safely deleted,
197+
since those branches are fully contained by HEAD.
198+
199+
- `--no-merged` is used to find branches which are candidates for merging
200+
into HEAD, since those branches are not fully contained by HEAD.
180201

181202
Author
182203
------

0 commit comments

Comments
 (0)