mr

myrepos — run version-control commands across many repositories at once

TLDR

Update every registered repo
$ mr update
Check the status of every repo
$ mr status
Commit changes across all repos with the same message
$ mr commit -m "[message]"
Register the current repo in `~/.mrconfig`
$ mr register
Run an arbitrary command inside every repo
$ mr run [git fetch]
Run only on a repo in the current directory subtree
$ mr -d [.] status
List configured repositories
$ mr list
Bootstrap a new checkout from a shared `.mrconfig`
$ mr checkout
Use a non-default config file
$ mr -c [/path/to/mrconfig] update
Run sequentially (disable default parallel jobs)
$ mr -s update

SYNOPSIS

mr [options] command [command args]

DESCRIPTION

mr (myrepos) orchestrates version-control operations across a heterogeneous collection of repositories. It reads per-repo action definitions from one or more `.mrconfig` files and runs them, so a single `mr update` can pull dozens of git repos, an svn checkout, and a mercurial clone in one go. Parallel execution (`-j`), timeouts (`-t`), and per-repo `skip` rules make it practical on large fleets.

PARAMETERS

-c CONFIG

Use CONFIG instead of `$HOME/.mrconfig`.
-d DIR
Operate only on the repository at DIR (or the closest enclosing one).
-t SECONDS
Timeout each sub-command after SECONDS.
-j N
Run N jobs in parallel (default 1, `-j0` = unlimited).
-s
Stop on first error (also serialize when using `-j`).
-i
Interactive: prompt before each action.
-n
Limit recursion: only act on repos whose path is under the current directory.
-p DIR
Chdir to DIR before running.
-f
Force action even on repos that are marked `skip`.
-v
Verbose.
-q
Quiet: suppress standard output from mr and its children.
-m
Commit message (for `commit`).
--version
Show version.
--help
Show help.

CONFIGURATION

~/.mrconfig (primary) and any `.mrconfig` in the current tree.Sections are per-repo; the `[DEFAULT]` section holds defaults. Commands are defined as shell blocks:

$ [src/vim]
checkout = git clone [email protected]:you/vim .
update = git pull --rebase
skip = [ "$1" = "fetch" ] && ! mr_any_args
Supported backends out of the box: git, subversion, mercurial, bazaar, cvs, darcs, fossil, veracity, git-svn, unison. Custom backends can be added by writing matching actions.

COMMON COMMANDS

checkout — clone every repo listed in the config.update — `git pull --rebase` / `svn update` / `hg pull -u` / etc., per-repo.status — show working-tree status for each repo.commit — commit (use `-m` to set a message).push / pull / fetch — VCS-specific wrappers.diff / log — per-repo diff or log.run CMD — run CMD in each repo directory.register [DIR] — add a repo (default: current) to the config.list — show repos that would be acted on.config [REPO] [KEY [VALUE]] — read/write config keys.bootstrap URL — fetch an `.mrconfig` from a URL and run `checkout`.online / offline — mark repos as reachable/unreachable for later `--online-only` runs.help — show help for a specific command.

INSTALL

sudo dnf install myrepos
sudo pacman -S myrepos
sudo apk add myrepos
sudo zypper install mr
brew install myrepos
nix profile install nixpkgs#mr

CAVEATS

Requires Perl. Parallel mode interleaves output; use `-j1` (the default) when you need clean logs. `mr commit` only commits already-staged (or tracked, depending on VCS) changes — it does not add new files.

HISTORY

mr / myrepos was created by Joey Hess and is now maintained by Richard Hartmann (RichiH). It has been packaged in Debian since the late 2000s and is the spiritual ancestor of tools like `vcsh` and `gita`.

SEE ALSO

git(1), vcsh(1), gita(1)