目录 搜索
Guides gitattributes giteveryday gitglossary gitignore gitmodules gitrevisions gittutorial gitworkflows Administration git archive git bundle git clean git filter-branch git fsck git gc git instaweb git reflog Basic Snapshotting git add git commit git diff git mv git reset git rm git status Branching and Merging git branch git checkout git log git merge git mergetool git stash git tag Debugging git bisect git blame git grep Email git am git format-patch git request-pull git send-email External Systems git fast-import git svn Getting and Creating Projects git clone git init Git git annotate git archimport git bisect-lk2009 git check-attr git check-mailmap git check-ref-format git checkout-index git cherry git citool git column git credential git credential-cache git credential-store git cvsexportcommit git cvsimport git cvsserver git diff-files git diff-tree git difftool git fast-export git fetch-pack git fmt-merge-msg git get-tar-commit-id git gui git http-backend git http-fetch git http-push git imap-send git index-pack git interpret-trailers git ls-remote git ls-tree git mailinfo git mailsplit git merge-file git merge-index git merge-one-file git merge-tree git mktag git mktree git name-rev git notes git p4 git pack-objects git pack-redundant git pack-refs git parse-remote git patch-id git prune git prune-packed git quiltimport git receive-pack git remote-ext git remote-fd git remote-testgit git repack git replace git rerere git send-pack git sh-i18n git sh-setup git shell git show-branch git show-index git stripspace git unpack-file git unpack-objects git upload-archive git upload-pack git var git verify-commit git verify-tag git whatchanged git worktree Inspection and Comparison git describe git shortlog git show Miscellaneous api credentials api index gitcli gitcore tutorial gitcredentials gitcvs migration gitdiffcore githooks gitk gitnamespaces gitremote helpers gitrepository layout gitsubmodules gittutorial 2 gitweb gitweb.conf pack format User Manual Patching git apply git cherry-pick git rebase git revert Plumbing Commands git cat-file git check-ignore git commit-tree git count-objects git diff-index git for-each-ref git hash-object git ls-files git merge-base git read-tree git rev-list git rev-parse git show-ref git symbolic-ref git update-index git update-ref git verify-pack git write-tree Server Admin git daemon git update-server-info Setup and Config git git config git help Sharing and Updating Projects git fetch git pull git push git remote git submodule
文字

名称

git-ls-remote  - 在远程存储库中列出引用

概要

git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]              [-q | --quiet] [--exit-code] [--get-url]              [--symref] [<repository> [<refs>…]]

描述

显示远程存储库中可用的引用以及关联的提交 ID。

选项

-h   --heads   -t   --tags

仅限于 refs / heads 和 ref / tags。这些选项是not相互排斥的; 当同时给出时,将显示存储在 refs / heads 和 refs / tags 中的引用。

--refs

不要在输出中显示剥皮标签或像 HEAD 这样的伪码。

-q   --quiet

不要将远程 URL 打印到 stderr。

--upload-pack=<exec>

指定git-upload-pack远程主机上的完整路径。这允许列出来自通过 SSH 访问的存储库的引用,并且 SSH 守护程序不使用用户配置的 PATH。

--exit-code

当在远程存储库中找不到匹配的参考时退出状态“2”。通常情况下,该命令以状态“0”退出,以指示它与远程存储库成功交谈,无论它是否找到任何匹配的参考。

--get-url

考虑到任何“url。<base> .insteadOf”配置设置(请参阅 git-config [1]),扩展给定远程存储库的 URL,并退出而不与远程进行通话。

--symref

除了它指向的对象之外,显示它在显示符号引用时指向的基础引用。目前,upload-pack 仅显示 symref HEAD,因此它将是 ls-remote 显示的唯一一个。

<repository>

用于查询的“远程”存储库。此参数可以是 URL 或远程名称(请参阅 git-fetch [1]的 GIT URLS 和 REMOTES 部分)。

<refs>…

如果未指定,则会显示使用--heads 和 --tags 进行筛选后的所有引用。当指定 <refs> ...时,只显示符合给定模式的引用。

示例

$ 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
上一篇: 下一篇: