Forrest logo
back to the git tool

git-ls-remote:tldr:f866e

git-ls-remote: Show all references in the default remote repository.
$ git ls-remote
try on your machine

The command "git ls-remote" is used to retrieve references in a remote repository. It lists all the references (such as branches, tags, and remote heads) present in a remote repository.

When you run the "git ls-remote" command, you provide the URL or name of the remote repository as an argument. Git then communicates with the remote repository and displays a list of all the references along with their corresponding object IDs or commit hashes.

This command can be helpful when you want to see the available branches or tags in a remote repository without actually cloning it. It can also be used to verify if a specific reference exists in the remote repository or to obtain the latest commit hash of a branch or tag.

Here's an example usage of the "git ls-remote" command:

git ls-remote https://github.com/example/repo.git

This command will display a list of references and their commit IDs in the remote repository located at "https://github.com/example/repo.git".

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the git tool