【问题标题】:How to retrieve to which remote and remote branch the current branch is corresponding to in Mercurial?如何在 Mercurial 中检索当前分支对应的远程和远程分支?
【发布时间】:2021-03-20 01:51:44
【问题描述】:

Git中获取remote当前分支名和remote分支名对应的可以使用如下命令:

git rev-parse --abbrev-ref --symbolic-full-name @{u}

它返回类似:

<some-remote-name>/<some-remote-branch-name>

其中&lt;some-remote-name&gt; 是远程的名称,&lt;some-remote-branch-name&gt; 是当前分支跟踪的远程分支的名称。

例如,可以是:

origin/master

如何在 Mercurial 中做同样的事情?

【问题讨论】:

    标签: git version-control mercurial


    【解决方案1】:

    Mercurial 分支没有 Git 语义; Mercurial 中的分支名称​​不是头部,而这些概念并不真正对应。 Mercurial 中的分支名称是真正的全局名称,您在您的 存储库中使用的名称就是其他 Mercurial 存储库将在他们的存储库中使用的名称。1 Git 中的分支名称具有上游设置,但 Mercurial 中的分支名称没有(它们不需要这个概念)。提交的分支是提交将永远在的分支;它永远不会在任何其他分支上。


    1Convert 扩展允许名称来回映射到不同 Mercurial 存储库中的不同字符串,但这里仍然存在基本问题。

    【讨论】:

      猜你喜欢
      • 2015-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-26
      • 2013-03-19
      • 2015-12-15
      • 2023-03-09
      相关资源
      最近更新 更多