git-ls-remote | A very simple interface | Command Line Interface library
kandi X-RAY | git-ls-remote Summary
kandi X-RAY | git-ls-remote Summary
A very simple interface to git-ls-remote for node.js.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of git-ls-remote
git-ls-remote Key Features
git-ls-remote Examples and Code Snippets
Community Discussions
Trending Discussions on git-ls-remote
QUESTION
Listing the most recent tag of a remote repository produces a different answer from cloning that repository and then describing its tags. E.g.
...ANSWER
Answered 2021-May-13 at 21:17I believe what you want is the first token from the output of git describe --tags
.
The two commands serve different purposes.
git ls-remote
lists the references on a remote repository, but does not make any promises about the ordering in which they are listed. Sure, the most recent one is typically last, but it's not necessarily the most relevant one, especially if that tag was on a branch that didn't get merged yet.
git describe
, on the other hand, is trying to give you a concise description of HEAD
(by default, or the commit you specify) with respect to the most recent tag reachable from there. If you use your tags only for stable commits, then that's probably going to be the tag you want. Then, once it found that tag, it tells you how many more commits are in HEAD
, 606 of them in your example, then "g" (not sure why), then the sha1 of HEAD
. This is meant to be a human-readable description of any commit, as in, "oh, you're 606 commits ahead of v2.31.1", but also an unambiguous description, since you get the sha1.
As for adding the --tags
option to git describe
, you need it if you have tags without annotations, e.g., if some where created using git tag
instead of git tag -a
. The latter is preferable, since it allows the tagger to describe the contents of the tag, but you can't always count on everyone using it. So it's probably a good idea to add --tags
to git describe
.
If your repo only contains tags for stable releases, and those releases are not on a different release branch, and you never have hyphens in your tag names, then this would be the most recent stable release that's a parent of HEAD
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install git-ls-remote
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page