Joe C
Joe C

Reputation: 2827

Can I use a git repo for a subfolder in a mercurial repo?

I have a mercurial repo in code.google that includes folders like

H
|_ A
|_ B
|_ C

The top-level folder H contains sub-folders A, B and C.

Now, I wanted to use Heroku to test the webserver in B, and Heroku only supports git. Since the testing is temporal, so I do not want to completely remove B from the mercurial repo. In the meanwhile, manually duplicating B for both hg and git does not seem stable.

Is there any better solution? Thanks,

Upvotes: 1

Views: 85

Answers (2)

Lazy Badger
Lazy Badger

Reputation: 97270

Common plan can be (dirty draft)

Using Folder B as git-subrepository in Mercurial repo at permanent basis

In order to do it (TBT! I can miss some actions)

  • Read about subrepositories in Mercurial (and understand all pros et contas) - also this guide from aragost Trifork
  • Add hg-git extension to you local Mercurial Installation in oder to work with Git repositories from Mercurial side
  • Convert Folder B to Mecurial subrepository (read manual again)
  • Clone Mercurial's B-repository into additional (external) Git repository
  • Replace Mercurial's B-repository with external Git repository

As expected result you'll be able (I hope) to work with old tree from Mercurial and test independent Git repository in Heroku

Upvotes: 1

gravetii
gravetii

Reputation: 9624

You can certainly do that - use git to version-control your web server in B. But realize that you need to separately commit changes in B for git apart from dealing with mercurial.

I believe you can also tweak around with hg-git and make it work for you.

Upvotes: 1

Related Questions