Mercurial, different default upstream and downstream path

Viewed 95

How do you configure mercurial to use different default remote repos when pull-ing and push-ing (i.e. not specifying that repo's name / path)?

Example:

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

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

I haven't found this on the StackOverflow yet (this is related, but not what I was looking for), so I answered my own quetion:

You can set a path named default:pushurl, as indicated by hg help config.paths

So, having a .hg/hgrc containing:

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

yields:

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

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