Skip to content

Commit de90ff8

Browse files
peffgitster
authored andcommitted
docs: clarify git-branch --list behavior
It was not clear from the "description" section of git-branch(1) that using a <pattern> meant that you _had_ to use the --list option. Let's clarify that, and while we're at it, reword some clunky and ambiguous sentences. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 045e388 commit de90ff8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Documentation/git-branch.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ SYNOPSIS
2222
DESCRIPTION
2323
-----------
2424

25-
With no arguments, existing branches are listed and the current branch will
26-
be highlighted with an asterisk. Option `-r` causes the remote-tracking
27-
branches to be listed, and option `-a` shows both. This list mode is also
28-
activated by the `--list` option (see below).
29-
<pattern> restricts the output to matching branches, the pattern is a shell
30-
wildcard (i.e., matched using fnmatch(3)).
31-
Multiple patterns may be given; if any of them matches, the branch is shown.
25+
If `--list` is given, or if there are no non-option arguments, existing
26+
branches are listed; the current branch will be highlighted with an
27+
asterisk. Option `-r` causes the remote-tracking branches to be listed,
28+
and option `-a` shows both local and remote branches. If a `<pattern>`
29+
is given, it is used as a shell wildcard to restrict the output to
30+
matching branches. If multiple patterns are given, a branch is shown if
31+
it matches any of the patterns. Note that when providing a
32+
`<pattern>`, you must use `--list`; otherwise the command is interpreted
33+
as branch creation.
3234

3335
With `--contains`, shows only the branches that contain the named commit
3436
(in other words, the branches whose tip commits are descendants of the

0 commit comments

Comments
 (0)