7

For the last 6 months or so I've been using a 2-way Git mirror of our main Perforce repository at work to evaluate it for our workflow. I have to say I've fallen in love with using it but it has had one fatal flaw for me so far: it's Windows support is terrible.

Generally this is not an issue for me but right now it is. I need to do some work on some locally committed work in my Git repo and I cannot get to it from the machine I need to work on as there are some unsolvable issues with the Git distro on this box.

Anyhow, what I want to do if I can is to run a second mirror: this time piggy-backing off of my Git repository but serving via Mercurial or Bazar. I've found a few tools that look promising and some references in blog comments saying that people have done this but nothing complete.

So can anyone tell me if there is a simple way to maintain a 2-way mirror to a Git repository using another DVCS that will work on Windows without any trouble?

Thanks in advance for your troubles...

Jamie

snap
  • 2,751
  • 22
  • 33
jkp
  • 78,960
  • 28
  • 103
  • 104

7 Answers7

6

A new option has popped up on the scene from the folks over at GitHub: git-hg. Now there's a way to do a two-way sync between Git and Mercurial.

jkp
  • 78,960
  • 28
  • 103
  • 104
3

I know that Mercurial has an extension that will let you convert from git to mercurial. More on https://www.mercurial-scm.org/wiki/ConvertExtension

I haven't used it myself though.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
kovica
  • 2,443
  • 3
  • 21
  • 25
  • 1
    I had a go with this last night: it doesn't convert the history from Git in a usable way, it merges all branches into the default branch due to the way Git treats branches internally. I need something I can do a reasonable two-way mirror with. – jkp Jan 05 '09 at 10:08
  • Points going here since it's the only answer that actually addresses the question I asked! Others might also like to look up "Taylor" which can help too... – jkp Jan 05 '09 at 13:38
  • Convert is strictly one-way. It's not the synchronization tool for which he's looking. – Ry4an Brase Jan 07 '09 at 07:20
3

[wikified since this isn't really an answer]

I'm using MSYS git without problems on Vista. I do host my git repos on a Debian GNU/Linux box though.

David Schmitt
  • 58,259
  • 26
  • 121
  • 165
  • The problem I have with Git on Windows is to do with the Windows box I use: It's a 64bit Windows 2008 install running on a KVM linux host as a VM. I've tried both Msys Git and cygwin: • Msys doesnt work on Windows 2008 64bit (knownbug) • Cygwin exposes bug in KVM. If I could I would! – jkp Jan 05 '09 at 10:07
  • Well, for anyone interested, I *finally* found a fix to the issue I had with msys Git: See [here for details][1] [1]: http://code.google.com/p/msysgit/issues/detail?id=122&colspec=ID%20Type%20Status%20Priority%20Component%20Owner%20Summary – jkp Jan 05 '09 at 13:37
  • Wow! What a pain. Congrats for finding a solution though! – David Schmitt Jan 06 '09 at 07:21
2

bzr has fast-import plugin, so you will be able to create 2-way conversion using fast-export/fast-import pair: http://bazaar-vcs.org/BzrFastImport

bialix
  • 20,053
  • 8
  • 46
  • 63
1

There's also tailor that allows mirroring between several repositories. I had it working on Cygwin with quite some success -- until someone added files that made the command line svn choke; though that might be a rather rare problem to hit.

bluebrother
  • 8,636
  • 1
  • 20
  • 21
0

Mercurial has probably the best support for Windows (out of git & bzr). It even has a TortoiseHg extension here.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Keltia
  • 14,535
  • 3
  • 29
  • 30
  • Mercurial is my preferred mirror but the question is how to create a 2-way Git / Mercurial mirror...if you know please do tell! Txs. – jkp Jan 05 '09 at 10:09
-1

I think you're not likely to find a satisfactory solution with the currently available git to other DVCS synchronization tools. You could probably cobble together a workable system using git-svn to go from get to subversion and hgsubversion to synchronize between mercurial and subversion, but that seems like a crazy kludge just to get around weak git support on windows.

Perhaps you'd be better off emailing diffs from the windows box -- git has excellent email-patch-handling support (as does mercurial).

Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169