HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

git ls-remote — Git command for listing references in a remote repository based on name or URL. If no name or URL ar

Submitted by: @import:tldr-pages··
0
Viewed 0 times
git ls-remotecommandclilistingforreferencesgit

Problem

How to use the git ls-remote command: Git command for listing references in a remote repository based on name or URL. If no name or URL are given, then the configured upstream branch will be used, or remote origin if the former is not configured. More information: <https://git-scm.com/docs/git-ls-remote>.

Solution

git ls-remote — Git command for listing references in a remote repository based on name or URL. If no name or URL are given, then the configured upstream branch will be used, or remote origin if the former is not configured. More information: <https://git-scm.com/docs/git-ls-remote>.

Show all references in the default remote repository:
git ls-remote


Show only heads references in the default remote repository:
git ls-remote --heads


Show only tags references in the default remote repository:
git ls-remote {{[-t|--tags]}}


Show all references from a remote repository based on name or URL:
git ls-remote {{repository_url}}


Show references from a remote repository filtered by a pattern:
git ls-remote {{repository_name}} "{{pattern}}"

Code Snippets

Show all references in the default remote repository

git ls-remote

Show only heads references in the default remote repository

git ls-remote --heads

Show only tags references in the default remote repository

git ls-remote {{[-t|--tags]}}

Show all references from a remote repository based on name or URL

git ls-remote {{repository_url}}

Show references from a remote repository filtered by a pattern

git ls-remote {{repository_name}} "{{pattern}}"

Context

tldr-pages: common/git ls-remote

Revisions (0)

No revisions yet.