Skip to content

Commit 6aac634

Browse files
committed
Merge branch 'jk/doc-ls-remote-matching'
Doc update. * jk/doc-ls-remote-matching: doc/ls-remote: clarify pattern format doc/ls-remote: cosmetic cleanups for examples
2 parents a42d69e + d9ec3b0 commit 6aac634

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

Documentation/git-ls-remote.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SYNOPSIS
1111
[verse]
1212
'git ls-remote' [--heads] [--tags] [--refs] [--upload-pack=<exec>]
1313
[-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]
14-
[--symref] [<repository> [<refs>...]]
14+
[--symref] [<repository> [<patterns>...]]
1515

1616
DESCRIPTION
1717
-----------
@@ -85,25 +85,32 @@ OPTIONS
8585
either a URL or the name of a remote (see the GIT URLS and
8686
REMOTES sections of linkgit:git-fetch[1]).
8787

88-
<refs>...::
88+
<patterns>...::
8989
When unspecified, all references, after filtering done
90-
with --heads and --tags, are shown. When <refs>... are
91-
specified, only references matching the given patterns
92-
are displayed.
90+
with --heads and --tags, are shown. When <patterns>... are
91+
specified, only references matching one or more of the given
92+
patterns are displayed. Each pattern is interpreted as a glob
93+
(see `glob` in linkgit:gitglossary[7]) which is matched against
94+
the "tail" of a ref, starting either from the start of the ref
95+
(so a full name like `refs/heads/foo` matches) or from a slash
96+
separator (so `bar` matches `refs/heads/bar` but not
97+
`refs/heads/foobar`).
9398

9499
EXAMPLES
95100
--------
96101

97102
----
98-
$ git ls-remote --tags ./.
103+
$ git ls-remote --tags .
99104
d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99
100105
f25a265a342aed6041ab0cc484224d9ca54b6f41 refs/tags/v0.99.1
101106
7ceca275d047c90c0c7d5afb13ab97efdf51bd6e refs/tags/v0.99.3
102107
c5db5456ae3b0873fc659c19fafdde22313cc441 refs/tags/v0.99.2
103108
0918385dbd9656cab0d1d81ba7453d49bbc16250 refs/tags/junio-gpg-pub
109+
104110
$ git ls-remote http://www.kernel.org/pub/scm/git/git.git master seen rc
105111
5fe978a5381f1fbad26a80e682ddd2a401966740 refs/heads/master
106112
c781a84b5204fb294c9ccc79f8b3baceeb32c061 refs/heads/seen
113+
107114
$ git remote add korg http://www.kernel.org/pub/scm/git/git.git
108115
$ git ls-remote --tags korg v\*
109116
d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99

builtin/ls-remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
static const char * const ls_remote_usage[] = {
99
N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
1010
" [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]\n"
11-
" [--symref] [<repository> [<refs>...]]"),
11+
" [--symref] [<repository> [<patterns>...]]"),
1212
NULL
1313
};
1414

0 commit comments

Comments
 (0)