How to set Mercurial upstream

喜你入骨 提交于 2019-12-03 23:50:42

You can do that by adding the upstream URL to /project/.hg/hgrc like this:

[paths]
default = ssh://test@bitbucket.com/repos/something
upstream = ssh://test@bitbucket.com/repos/something_else

and now upstream is an alias for repo something_else which you can then pull from or push to:

hg pull upstream
hg push upstream

Reference

hg help urls:

URLs can all be stored in your configuration file with path aliases under the [paths] section like so:

  [paths]
  alias1 = URL1
  alias2 = URL2
  ...

You can then use the alias for any command that uses a URL (for example hg pull alias1 will be treated as hg pull URL1).

Two path aliases are special because they are used as defaults when you do not provide the URL to a command:

  1. default
  2. default-push
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!