Skip to content

Commit 51f9d2e

Browse files
vermiculusgitster
authored andcommitted
ls-remote doc: document the output format
While well-established, the output format of ls-remote was not actually documented. This patch adds an OUTPUT section to the documentation following the format of git-show-ref.txt (which has similar semantics). Add a basic example immediately after this to solidify the 'normal' output format. Signed-off-by: Sean Allred <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a5b0763 commit 51f9d2e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Documentation/git-ls-remote.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,35 @@ OPTIONS
9696
separator (so `bar` matches `refs/heads/bar` but not
9797
`refs/heads/foobar`).
9898

99+
OUTPUT
100+
------
101+
102+
The output is in the format:
103+
104+
------------
105+
<oid> TAB <ref> LF
106+
------------
107+
108+
When showing an annotated tag, unless `--refs` is given, two such
109+
lines are shown: one with the refname for the tag itself as `<ref>`,
110+
and another with `<ref>` followed by `^{}`. The `<oid>` on the latter
111+
line shows the name of the object the tag points at.
112+
99113
EXAMPLES
100114
--------
101115

116+
* List all references (including symbolics and pseudorefs), peeling
117+
tags:
118+
+
119+
----
120+
$ git ls-remote
121+
27d43aaaf50ef0ae014b88bba294f93658016a2e HEAD
122+
950264636c68591989456e3ba0a5442f93152c1a refs/heads/main
123+
d9ab777d41f92a8c1684c91cfb02053d7dd1046b refs/heads/next
124+
d4ca2e3147b409459955613c152220f4db848ee1 refs/tags/v2.40.0
125+
73876f4861cd3d187a4682290ab75c9dccadbc56 refs/tags/v2.40.0^{}
126+
----
127+
102128
* List all references matching given patterns:
103129
+
104130
----

0 commit comments

Comments
 (0)