I have been developing over the past few weeks a tool to synchronize a set of git repositories, gits. I use an earlier version of it, written in OCaml on a daily basis to synchronize all my repositories (I have over 15 such repositories, so synchronizing them manually is not an option). I decided to give it a rewrite to release it.

A brief history

I have been organizing my data around a few git repositories. A few of them are public and available here. To synchronize them around I needed a script that would run git pull && git push in each repository. As time passed, I needed more advanced features such as

  • automatically clone (or remove) repositories present in only one side

  • synchronizes branches too

This led to a first implementation in OCaml that you can find here. I decided that it could benefit from a modular rewrite allowing for more DCVS to be supported, and that it could interest some people.

Quick overview

gits is a program to manage stores of repository. A store is a directory containing only repositories, indexed by their relative path to the root of the store. For instance, my $HOME/git is composed with the following hierarchy

  • configuration: stores my dotfiles
  • scripts: stores my scripts
  • personal: stores personal data such as org-mode files
  • wikis/templates: stores the templates for this wiki
  • wikis/wiki: stores the articles for this wiki
  • projets/..: stores my project.

With gits I can easily synchrnize these repository as well as track branches and automatically clone new repository. The command I run to do that is simply

gits kiwi:kiwi.iuwt.fr:/home/asmanur/git/

The first field specifies the name of the remote store. It will be used as a git remote so that if I want to do git operations outside gits, I can use remote names instead of URLs.

Why a rewrite

The old script is a bit hard to maintain and I would like to handle different kind of DCVS (at least darcs, but also mercury), as well as have a proper configuration file and so on. As is the script is also not usable outside my environment (there is the path to the binary hardcoded).

State of the development

The new version of gits is almost as usable as the old one. You can monitor the development with the cgit interface.