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

I have a mercurial repo in that includes folders like

|_ A
|_ B
|_ C

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

  • When should I use git pull --rebase?
  • Merge branches without checking out branch
  • Unable to resolve reference refs /refs/remotes/origin/branch while pushing after merging branches
  • Database Schema Migration on Azure with Git Deployment
  • Undo git push to Assembla
  • Bash. Line-by-line output into another procedure
  • 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,

  • Regex-like shell glob patterns for gitignore
  • Build jenkins job when push code to bitbucket
  • Any command to store Git username password without inital prompt
  • Jenkins Pipeline job can't find script due to @tmp path being created
  • How can multiple people contribute to resolving conflicts during a large DVCS rebase operation?
  • Git Version numbering with a centralized workflow
  • 2 Solutions collect form web for “Can I use a git repo for a subfolder in a mercurial repo?”

    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.

    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

    Git Baby is a git and github fan, let's start git clone.