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
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.
- How to synchronize multiple git repositories including tags and branches?
- Local repository with Git
- SVN: how to ignore folder without removing it from my repository
- Path '.gitmodules' does not exist in '31627edc0c80332d93e694cb0ed379531fbc9de0'
- Git https:// repository not found though it exists
- GitHub undo a discard
So initially I have 2 questions:
- How to compare sources from Git and Mercurial
- 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.
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.