Mercurial,不同的默认上游和下游路径

时间:2017-11-03 16:31:11

标签: mercurial push pull

如何配置mercurial以在拉取和推送时使用不同的默认远程回购(即不指定回购的名称/路径)?

示例:

$ hg pull
pulling from https://pull.from.here

$ hg push
pushing to https://push.to.here

1 个答案:

答案 0 :(得分:4)

我还没有在StackOverflow上找到这个(this是相关的,但不是我想要的),所以我回答了自己的问题:

您可以设置名为default:pushurl的路径,如hg help config.paths

所示

所以,让.hg/hgrc包含:

[paths]
default = https://pull.from.here
default:pushurl = https://push.to.here

的产率:

$ hg pull
pulling from https://pull.from.here

$ hg push
pushing to https://push.to.here