compare sources from git and mercurial repositories and synchronize them

In our project due to the way of team operating and corporate security policy the same codebase hosted inside 2 repositories, one is git, 2nd is mercurial and one part of the team normally committing to mercurial repo, 2nd part commit to git.

Because of such a strange way of operating with some time codebase in 2 repos stop being synchronized, and I need to make it sync again.

So initially I have 2 questions:

  1. How to compare sources from Git and Mercurial
  2. How to synchronize them.

UPD1: In case of synchronization, I don’t think it’s need to be super advanced, e.g. have the same commit’s history or something like that. If it’s just will put files in the same state (where possible, manual merging in other case) – that’s will be more than completely fine.

  • git pull hangs after authentication
  • VS 2013 + Git + Visual Studio Online + multiple Repos in one project
  • Moving a git repository down a hierarchy level
  • Central and local git repository with WAMP on local network
  • Moving a git repository
  • new svn server, same ip
  • Errors in dumping a remote Git based SVN repository over HTTP
  • Use Git “locally” over SSH
  • One Solution collect form web for “compare sources from git and mercurial repositories and synchronize them”

    To compare the sources, you could clone the mercurial and the git repo in your computer, and use diff on those directories. For example:

    diff -rq git_repo hg_repo | grep -v .git | grep -v .hg
    

    The synchronisation part is harder: it depends on what you want to do in cases where the code diverged between the two. I guess you can do it manually using the list of diffs generated previously, but I can’t think of a more automated way.

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