How do I “switch” with Mercurial

前端 未结 5 848
耶瑟儿~
耶瑟儿~ 2021-01-31 01:25

How do I do what svn switch does, in Mercurial?

That is change my working directory to switch to another branch in the repository?

5条回答
  •  醉酒成梦
    2021-01-31 01:59

    Alternate answer, in case by "branch" you mean "another clone of the repo that lives in some arbitrary location on the net": you can't.

    In other words, given a repo at hg.a.com, and a clone of that repo hg.b.com, there is no command like

    hg switch hg.b.com .
    

    (using svn parlance there, assuming your current directory is the root of a clone of hg.a.com).

    However, you can clone hg.a.com, locally clone that clone (which should be relatively inexpensive), and then pull from hg.b.com to pick up any additional changes that might live there.

提交回复
热议问题