Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-ls-remote(1) |
| 2 | ================ |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 6 | git-ls-remote - List references in a remote repository |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 11 | [verse] |
Junio C Hamano | ffe10ca | 2016-02-04 00:44:23 | [diff] [blame] | 12 | 'git ls-remote' [--heads] [--tags] [--refs] [--upload-pack=<exec>] |
Junio C Hamano | ccb8252 | 2018-05-08 07:52:09 | [diff] [blame^] | 13 | [-q | --quiet] [--exit-code] [--get-url] [--sort=<key>] |
Junio C Hamano | ffe10ca | 2016-02-04 00:44:23 | [diff] [blame] | 14 | [--symref] [<repository> [<refs>...]] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 15 | |
| 16 | DESCRIPTION |
| 17 | ----------- |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 18 | Displays references available in a remote repository along with the associated |
| 19 | commit IDs. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 20 | |
| 21 | |
| 22 | OPTIONS |
| 23 | ------- |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 24 | -h:: |
| 25 | --heads:: |
| 26 | -t:: |
| 27 | --tags:: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 28 | Limit to only refs/heads and refs/tags, respectively. |
| 29 | These options are _not_ mutually exclusive; when given |
| 30 | both, references stored in refs/heads and refs/tags are |
| 31 | displayed. |
| 32 | |
Junio C Hamano | ffe10ca | 2016-02-04 00:44:23 | [diff] [blame] | 33 | --refs:: |
| 34 | Do not show peeled tags or pseudorefs like HEAD in the output. |
| 35 | |
| 36 | -q:: |
| 37 | --quiet:: |
| 38 | Do not print remote URL to stderr. |
| 39 | |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 40 | --upload-pack=<exec>:: |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 41 | Specify the full path of 'git-upload-pack' on the remote |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 42 | host. This allows listing references from repositories accessed via |
Junio C Hamano | f9771f6 | 2007-01-17 17:42:30 | [diff] [blame] | 43 | SSH and where the SSH daemon does not use the PATH configured by the |
Junio C Hamano | 1fbbbc1 | 2007-12-18 07:01:27 | [diff] [blame] | 44 | user. |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 45 | |
Junio C Hamano | 2a294cd | 2011-05-23 23:06:31 | [diff] [blame] | 46 | --exit-code:: |
| 47 | Exit with status "2" when no matching refs are found in the remote |
| 48 | repository. Usually the command exits with status "0" to indicate |
| 49 | it successfully talked with the remote repository, whether it |
| 50 | found any matching refs. |
| 51 | |
Junio C Hamano | f76c10b | 2012-09-14 20:11:04 | [diff] [blame] | 52 | --get-url:: |
| 53 | Expand the URL of the given remote repository taking into account any |
| 54 | "url.<base>.insteadOf" config setting (See linkgit:git-config[1]) and |
| 55 | exit without talking to the remote. |
| 56 | |
Junio C Hamano | ffe10ca | 2016-02-04 00:44:23 | [diff] [blame] | 57 | --symref:: |
| 58 | In addition to the object pointed by it, show the underlying |
| 59 | ref pointed by it when showing a symbolic ref. Currently, |
| 60 | upload-pack only shows the symref HEAD, so it will be the only |
| 61 | one shown by ls-remote. |
| 62 | |
Junio C Hamano | ccb8252 | 2018-05-08 07:52:09 | [diff] [blame^] | 63 | --sort=<key>:: |
| 64 | Sort based on the key given. Prefix `-` to sort in descending order |
| 65 | of the value. Supports "version:refname" or "v:refname" (tag names |
| 66 | are treated as versions). The "version:refname" sort order can also |
| 67 | be affected by the "versionsort.suffix" configuration variable. |
| 68 | See linkgit:git-for-each-ref[1] for more sort options, but be aware |
| 69 | keys like `committerdate` that require access to the objects |
| 70 | themselves will not work for refs whose objects have not yet been |
| 71 | fetched from the remote, and will give a `missing object` error. |
| 72 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 73 | <repository>:: |
Junio C Hamano | a195230 | 2013-07-01 21:31:18 | [diff] [blame] | 74 | The "remote" repository to query. This parameter can be |
| 75 | either a URL or the name of a remote (see the GIT URLS and |
| 76 | REMOTES sections of linkgit:git-fetch[1]). |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 77 | |
| 78 | <refs>...:: |
| 79 | When unspecified, all references, after filtering done |
| 80 | with --heads and --tags, are shown. When <refs>... are |
| 81 | specified, only references matching the given patterns |
| 82 | are displayed. |
| 83 | |
| 84 | EXAMPLES |
| 85 | -------- |
| 86 | |
| 87 | $ git ls-remote --tags ./. |
| 88 | d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99 |
| 89 | f25a265a342aed6041ab0cc484224d9ca54b6f41 refs/tags/v0.99.1 |
| 90 | 7ceca275d047c90c0c7d5afb13ab97efdf51bd6e refs/tags/v0.99.3 |
| 91 | c5db5456ae3b0873fc659c19fafdde22313cc441 refs/tags/v0.99.2 |
| 92 | 0918385dbd9656cab0d1d81ba7453d49bbc16250 refs/tags/junio-gpg-pub |
| 93 | $ git ls-remote http://www.kernel.org/pub/scm/git/git.git master pu rc |
| 94 | 5fe978a5381f1fbad26a80e682ddd2a401966740 refs/heads/master |
| 95 | c781a84b5204fb294c9ccc79f8b3baceeb32c061 refs/heads/pu |
Junio C Hamano | a195230 | 2013-07-01 21:31:18 | [diff] [blame] | 96 | $ git remote add korg http://www.kernel.org/pub/scm/git/git.git |
| 97 | $ git ls-remote --tags korg v\* |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 98 | d6602ec5194c87b0fc87103ca4d67251c76f233a refs/tags/v0.99 |
| 99 | f25a265a342aed6041ab0cc484224d9ca54b6f41 refs/tags/v0.99.1 |
| 100 | c5db5456ae3b0873fc659c19fafdde22313cc441 refs/tags/v0.99.2 |
| 101 | 7ceca275d047c90c0c7d5afb13ab97efdf51bd6e refs/tags/v0.99.3 |
| 102 | |
Junio C Hamano | ccb8252 | 2018-05-08 07:52:09 | [diff] [blame^] | 103 | SEE ALSO |
| 104 | -------- |
| 105 | linkgit:git-check-ref-format[1]. |
| 106 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 107 | GIT |
| 108 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 109 | Part of the linkgit:git[1] suite |