Personal web page: Emmanuel Branlard

Manage multiple git repositories using mr

mr is a lightweight program that can manage your repositories, and run commands accross all of them. This is extremely useful in general to check the status of many repositories:

mr status
Or to checkout the latest version of many repositories:

mr checkout
The repositories are configured in a file named '.mrconfig'. mr looks in all parent directories until it finds such a file. The .mrconfig file is as follows:


[MyProjects/vim-matlab-behave/]

[MyProjects/wmctrl-for-windows/]
checkout = git clone 'git@github.com:elmanuelito/wmctrl-for-windows' 'wmctrl-for-windows'

[MyProjects/xdotool-for-windows]
checkout = git clone 'git@github.com:elmanuelito/xdotool-for-windows' 'xdotool-for-windows'

In the above example, the file '.mrconfig' is assumed to be located in the parent directory of the folder 'Projects'. The first repository is assumed to already be present. For the two following ones, the 'checkout' command is overriden which can be convenient to: clone the directory from scratch, AND, to use ssh and not http protocol