How do I “switch” with Mercurial

前端 未结 5 851
耶瑟儿~
耶瑟儿~ 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 02:06

    I you want to switch branches, do the following:

    First check what branches are available, type hg branches. This will list all the available branches.

    Next determine which branch you are currently working on, type hg branch. This will tell you what is your current branch.

    Finally to switch a branch (and wipe all local changes), type hg update -C name-of-branch. This will switch you to the branch name you specified.

    Verify by typing hg branch again.

提交回复
热议问题