uTools-Manuals/docs/git/git ls-remote.html
2019-04-08 23:22:26 +08:00

6 lines
4.7 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="c-markdown doc-markdown"><div class="doc-postil"><div class="c-markdown"><h2>名称</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>git-ls-remote  - 在远程存储库中列出引用</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>概要</h2></div></div><div class="doc-postil"><div class="c-markdown"><pre class="prism-token token language-javascript">git ls-remote [--heads] [--tags] [--refs] [--upload-pack=&lt;exec&gt;]              [-q | --quiet] [--exit-code] [--get-url]              [--symref] [&lt;repository&gt; [&lt;refs&gt;…]]</pre></div></div><div class="doc-postil"><div class="c-markdown"><h2>描述</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>显示远程存储库中可用的引用以及关联的提交 ID。</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>选项</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>-h   --heads   -t   --tags</p></div></div><div class="doc-postil"><div class="c-markdown"><p>仅限于 refs / heads 和 ref / tags。这些选项是<code>not</code>相互排斥的; 当同时给出时,将显示存储在 refs / heads 和 refs / tags 中的引用。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>--refs</p></div></div><div class="doc-postil"><div class="c-markdown"><p>不要在输出中显示剥皮标签或像 HEAD 这样的伪码。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>-q   --quiet</p></div></div><div class="doc-postil"><div class="c-markdown"><p>不要将远程 URL 打印到 stderr。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>--upload-pack=&lt;exec&gt;</p></div></div><div class="doc-postil"><div class="c-markdown"><p>指定<code>git-upload-pack</code>远程主机上的完整路径。这允许列出来自通过 SSH 访问的存储库的引用,并且 SSH 守护程序不使用用户配置的 PATH。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>--exit-code</p></div></div><div class="doc-postil"><div class="c-markdown"><p>当在远程存储库中找不到匹配的参考时退出状态“2”。通常情况下该命令以状态“0”退出以指示它与远程存储库成功交谈无论它是否找到任何匹配的参考。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>--get-url</p></div></div><div class="doc-postil"><div class="c-markdown"><p>考虑到任何“url。&lt;base&gt; .insteadOf”配置设置请参阅 git-config [1]),扩展给定远程存储库的 URL并退出而不与远程进行通话。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>--symref</p></div></div><div class="doc-postil"><div class="c-markdown"><p>除了它指向的对象之外显示它在显示符号引用时指向的基础引用。目前upload-pack 仅显示 symref HEAD因此它将是 ls-remote 显示的唯一一个。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>&lt;repository&gt;</p></div></div><div class="doc-postil"><div class="c-markdown"><p>用于查询的“远程”存储库。此参数可以是 URL 或远程名称(请参阅 git-fetch [1]的 GIT URLS 和 REMOTES 部分)。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>&lt;refs&gt;</p></div></div><div class="doc-postil"><div class="c-markdown"><p>如果未指定,则会显示使用--heads 和 --tags 进行筛选后的所有引用。当指定 &lt;refs&gt; ...时,只显示符合给定模式的引用。</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>示例</h2></div></div><div class="doc-postil"><div class="c-markdown"><pre class="prism-token token language-javascript">$ git ls-remote --tags ./.d6602ec5194c87b0fc87103ca4d67251c76f233a        refs/tags/v0.99f25a265a342aed6041ab0cc484224d9ca54b6f41        refs/tags/v0.99.17ceca275d047c90c0c7d5afb13ab97efdf51bd6e        refs/tags/v0.99.3c5db5456ae3b0873fc659c19fafdde22313cc441        refs/tags/v0.99.20918385dbd9656cab0d1d81ba7453d49bbc16250        refs/tags/junio-gpg-pub
$ git ls-remote http://www.kernel.org/pub/scm/git/git.git master pu rc
5fe978a5381f1fbad26a80e682ddd2a401966740        refs/heads/master
c781a84b5204fb294c9ccc79f8b3baceeb32c061        refs/heads/pu
$ git remote add korg http://www.kernel.org/pub/scm/git/git.git
$ git ls-remote --tags korg v\*d6602ec5194c87b0fc87103ca4d67251c76f233a        refs/tags/v0.99f25a265a342aed6041ab0cc484224d9ca54b6f41        refs/tags/v0.99.1c5db5456ae3b0873fc659c19fafdde22313cc441        refs/tags/v0.99.27ceca275d047c90c0c7d5afb13ab97efdf51bd6e        refs/tags/v0.99.3</pre></div></div></div>