2020-10-08 12:50:01 +01:00
|
|
|
# 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.
|
2021-01-08 15:22:46 +00:00
|
|
|
> More information: <https://git-scm.com/docs/git-ls-remote>.
|
2020-10-08 12:50:01 +01:00
|
|
|
|
2020-11-01 13:40:05 +00:00
|
|
|
- Show all references in the default remote repository:
|
2020-10-08 12:50:01 +01:00
|
|
|
|
|
|
|
`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 --tags`
|
|
|
|
|
2020-11-01 13:40:05 +00:00
|
|
|
- Show all references from a remote repository based on name or url:
|
2020-10-08 12:50:01 +01:00
|
|
|
|
2020-11-01 13:40:05 +00:00
|
|
|
`git ls-remote {{repository_url}}`
|
2020-10-08 12:50:01 +01:00
|
|
|
|
2020-11-01 13:40:05 +00:00
|
|
|
- Show references from a remote repository filtered by a pattern:
|
2020-10-08 12:50:01 +01:00
|
|
|
|
2020-11-01 13:40:05 +00:00
|
|
|
`git ls-remote {{repository_name}} "{{pattern}}"`
|