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

例:

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

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

最佳答案

我还没有在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

07-24 09:45
查看更多