Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using git but pushing to mercurial?

I have a new job however they use mercurial as their version control and most of my experience is with git. I try to learn mercurial but the way it does branching (even with extensions like bookmarks) just make absolutely no sense to me. Does anyone know of a way to use git locally but push to mercurial?

I have tried the hg-git plugin and have gotten to the point where I can commit in git and push those changes to a remote mercurial repo however the issue I am running into is that no matter what tutorial I have found, I can't seem to pull new changes from mercurial back into git (which makes the entire thing useless at this point). If you have a link on how to setup hg-git to work pushing to mercurial, please let me know of it.

The Solution (I think)

Base on the comments made by Lazy Badger, this is what I think will work : http://ryanzec.com/index.php/blog/details/9

like image 450
ryanzec Avatar asked Oct 25 '11 20:10

ryanzec


1 Answers

Think some time, see alternative solution, same lopsided and crooked, but less pretentious (I hope) - 3 repos (2 Mercurial + 1 Git) in 3-tier architecture of chain

They have (local) names, used below:

  • Master (hg) - central Mercurial repo of company
  • Mediator (hg) - middleware for translating changesets, created as clone of Master
  • WorkHorse (git) - final workplace, empty at start

Mediator have setting almost identical (hg-git, bookmarks) to hg-repo from solution 1, except one detail in [paths] section of hgrc - will be two path in in: Master and WorkHorse in order to be able pull|push in both direction, with Master and WorkHorse

Workflow:

  • Mediator pull changes from Master, push to WorkHorse (changesets presented as is, without collapsing, contrary to solution 1)
  • All (almost? not sure about merges) work happens on WorkHorse
  • Mediator pull changes from WorkHorse, push to Master
like image 180
Lazy Badger Avatar answered Nov 12 '22 18:11

Lazy Badger