mercurial-ruby icon indicating copy to clipboard operation
mercurial-ruby copied to clipboard

Clone a particular branch

Open monksy opened this issue 10 years ago • 1 comments

There doesn't appear to be a way to specify a particular branch that you can clone when you use Repository::clone.

Also, it does not appear that there is anyway to change the current branch of the repository.

monksy avatar Feb 26 '15 00:02 monksy

Use Mercurial::Shell.run and add an extra option -b. E.g.

Mercurial::Shell.run(["clone ? ? ?", "-bmy_branch", "file:///home/bozydar/workspaces/example-repo", "/tmp/example-repo-clone/"], :append_hg => true)

I believe that in the same way you can change the current branch

bozydar avatar Mar 08 '15 17:03 bozydar