列出Mercurial中的远程分支机构 [英] List remote branches in Mercurial
问题描述
有没有办法像Git中那样列出Mercurial中的远程分支机构?
Is there a way to list remote branches in Mercurial like there in Git?
git branch -r
我想列出远程计算机(例如Bitbucket)上的分支,所以使用:
I want to list the branches on a remote machine (e.g. Bitbucket), so using:
hg branches -R `hg showconfig paths.default` --color false
中止失败:存储库不在本地
fails with abort: repository not local
推荐答案
否,如果不将其克隆到本地,就不可能列出远程存储库的分支.
No, it is not possible to list branches of a remote repository without cloning it to local.
如果可以通过SSH访问具有远程存储库的计算机,则可以直接使用Mercurial:ssh server hg -R path/to/repo branches
.
If there is SSH access to the machine having the remote repository, then Mercurial could be used directly: ssh server hg -R path/to/repo branches
.
如果存储库与hgweb一起提供,则可以使用原始样式从中获取分支列表,以方便解析: https://www.mercurial-scm.org/repo/hg/branches?style=raw
If the repository is served with hgweb, then a list of branches can be fetched from that, using the raw style for easy parsing: https://www.mercurial-scm.org/repo/hg/branches?style=raw
BitBucket具有自己的API,可以在其中获取分支,请参见他们的帮助,然后像 https://api这样的网址进行查询.bitbucket.org/1.0/repositories/mirror/mercurial/branches/
BitBucket has its own API, where it is possible to get the branches, see their help and make a query like to a URL like https://api.bitbucket.org/1.0/repositories/mirror/mercurial/branches/
这篇关于列出Mercurial中的远程分支机构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!