如何配置mercurial以在拉取和推送时使用不同的默认远程回购(即不指定回购的名称/路径)?
示例:
$ hg pull
pulling from https://pull.from.here
$ hg push
pushing to https://push.to.here
答案 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