ls-remote to query remote without fetch

suggest change

git ls-remote queries a remote repository without cloning or fetching it first.

It lists refs/heads and refs/tags on that remote.

An annotated tag can appear twice: refs/tags/v0.1.6 and refs/tags/v0.1.6^{}. The ^{} line is the commit the tag points to.

Since Git 2.8 (March 2016), git ls-remote --refs omits those peeled ^{} lines and pseudorefs such as HEAD, so each tag is listed once:

git ls-remote --refs

It can also help resolve the actual url used by a remote repo when you have "url.<base>.insteadOf" config setting.
If git remote --get-url <aremotename> returns https://server.com/user/repo, and you have set git config url.ssh://git@server.com:.insteadOf https://server.com/:

git ls-remote --get-url <aremotename>
ssh://git@server.com:user/repo

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents