]> git.ipfire.org Git - thirdparty/git.git/blob - Documentation/git-ls-remote.txt
Merge branch 'ea/blame-use-oideq'
[thirdparty/git.git] / Documentation / git-ls-remote.txt
1 git-ls-remote(1)
2 ================
3
4 NAME
5 ----
6 git-ls-remote - List references in a remote repository
7
8
9 SYNOPSIS
10 --------
11 [verse]
12 'git ls-remote' [--heads] [--tags] [--refs] [--upload-pack=<exec>]
13 [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>]
14 [--symref] [<repository> [<refs>...]]
15
16 DESCRIPTION
17 -----------
18 Displays references available in a remote repository along with the associated
19 commit IDs.
20
21
22 OPTIONS
23 -------
24 -h::
25 --heads::
26 -t::
27 --tags::
28 Limit to only refs/heads and refs/tags, respectively.
29 These options are _not_ mutually exclusive; when given
30 both, references stored in refs/heads and refs/tags are
31 displayed. Note that `git ls-remote -h` used without
32 anything else on the command line gives help, consistent
33 with other git subcommands.
34
35 --refs::
36 Do not show peeled tags or pseudorefs like `HEAD` in the output.
37
38 -q::
39 --quiet::
40 Do not print remote URL to stderr.
41
42 --upload-pack=<exec>::
43 Specify the full path of 'git-upload-pack' on the remote
44 host. This allows listing references from repositories accessed via
45 SSH and where the SSH daemon does not use the PATH configured by the
46 user.
47
48 --exit-code::
49 Exit with status "2" when no matching refs are found in the remote
50 repository. Usually the command exits with status "0" to indicate
51 it successfully talked with the remote repository, whether it
52 found any matching refs.
53
54 --get-url::
55 Expand the URL of the given remote repository taking into account any
56 "url.<base>.insteadOf" config setting (See linkgit:git-config[1]) and
57 exit without talking to the remote.
58
59 --symref::
60 In addition to the object pointed by it, show the underlying
61 ref pointed by it when showing a symbolic ref. Currently,
62 upload-pack only shows the symref HEAD, so it will be the only
63 one shown by ls-remote.
64
65 --sort=<key>::
66 Sort based on the key given. Prefix `-` to sort in descending order
67 of the value. Supports "version:refname" or "v:refname" (tag names
68 are treated as versions). The "version:refname" sort order can also
69 be affected by the "versionsort.suffix" configuration variable.
70 See linkgit:git-for-each-ref[1] for more sort options, but be aware
71 keys like `committerdate` that require access to the objects
72 themselves will not work for refs whose objects have not yet been
73 fetched from the remote, and will give a `missing object` error.
74
75 -o <option>::
76 --server-option=<option>::
77 Transmit the given string to the server when communicating using
78 protocol version 2. The given string must not contain a NUL or LF
79 character.
80 When multiple `--server-option=<option>` are given, they are all
81 sent to the other side in the order listed on the command line.
82
83 <repository>::
84 The "remote" repository to query. This parameter can be
85 either a URL or the name of a remote (see the GIT URLS and
86 REMOTES sections of linkgit:git-fetch[1]).
87
88 <refs>...::
89 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.
93
94 EXAMPLES
95 --------
96
97 ----
98 $ git ls-remote --tags ./.
99 d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99
100 f25a265a342aed6041ab0cc484224d9ca54b6f41 refs/tags/v0.99.1
101 7ceca275d047c90c0c7d5afb13ab97efdf51bd6e refs/tags/v0.99.3
102 c5db5456ae3b0873fc659c19fafdde22313cc441 refs/tags/v0.99.2
103 0918385dbd9656cab0d1d81ba7453d49bbc16250 refs/tags/junio-gpg-pub
104 $ git ls-remote http://www.kernel.org/pub/scm/git/git.git master seen rc
105 5fe978a5381f1fbad26a80e682ddd2a401966740 refs/heads/master
106 c781a84b5204fb294c9ccc79f8b3baceeb32c061 refs/heads/seen
107 $ git remote add korg http://www.kernel.org/pub/scm/git/git.git
108 $ git ls-remote --tags korg v\*
109 d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99
110 f25a265a342aed6041ab0cc484224d9ca54b6f41 refs/tags/v0.99.1
111 c5db5456ae3b0873fc659c19fafdde22313cc441 refs/tags/v0.99.2
112 7ceca275d047c90c0c7d5afb13ab97efdf51bd6e refs/tags/v0.99.3
113 ----
114
115 SEE ALSO
116 --------
117 linkgit:git-check-ref-format[1].
118
119 GIT
120 ---
121 Part of the linkgit:git[1] suite