Forrest logo
back to the git tool

git-ls-remote:tldr:5ce41

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

The command "git ls-remote --heads" is used to list remote references (such as branches) in a Git repository.

Here is a breakdown of the command:

  • "git": This is the command-line interface for Git, a version control system.

  • "ls-remote": This is a Git subcommand that allows you to retrieve remote references.

  • "--heads": This option is used to specify that only branch references should be listed. It filters the results to only show branch heads (the latest commit for each branch).

When you run the "git ls-remote --heads" command, Git will connect to the remote repository and retrieve a list of all branch references. This can be useful to see the current state of remote branches or to check if a specific branch exists on the remote repository.

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