mr
Manage multiple repositories using a configuration file
TLDR
Register a repository
Update repositories in 5 concurrent jobs
Print the status of all repositories
Checkout all repositories to the latest version
SYNOPSIS
mr [options] [action] [repository or group ...]
mr [options] -c configfile [action] [repository or group ...]
PARAMETERS
-a
Operate on all configured repositories. This is the default behavior if no specific repositories or groups are listed.
-c file
Specify an alternative configuration file to use instead of the default ~/.mrconfig.
-d dir
Operate on repositories found within the specified directory, overriding the configured paths if necessary.
-f
Force the action, overriding safety checks and potentially interactive prompts.
-g group
Operate only on repositories belonging to the specified group as defined in the configuration file.
-i
Run interactively, prompting for confirmation before performing an action on each repository.
-j num
Execute up to num jobs in parallel. This can significantly speed up operations across many repositories.
-m
Operate only on 'missing' repositories; those that are configured but not yet checked out or present locally.
-q
Operate quietly, suppressing non-essential output.
-s
Show a list of repositories that would be acted upon, then exit without performing any action.
-S
Show a list of repositories and their full paths that would be acted upon, then exit without performing any action.
-v
Be verbose, providing more detailed output about the operations being performed.
--help
Display a help message and exit.
--version
Show the version information for mr and exit.
DESCRIPTION
mr is a versatile command-line tool designed to streamline the management of numerous version control repositories from a single interface. It supports a wide array of systems, including Git, Subversion, Mercurial, Bazaar, and Darcs. By reading its configuration from a file (commonly ~/.mrconfig), mr allows users to define the location and type of each repository.
The primary benefit of mr lies in its ability to execute common version control actions—such as update, status, commit, or diff—across all or a specified subset of registered repositories simultaneously. This drastically simplifies workflows for developers working on multiple projects, potentially across different VCS types. It also supports parallel execution of commands, improving efficiency for large collections of repositories. mr acts as a convenient wrapper, translating generic commands into the specific syntax required by each underlying VCS.
CAVEATS
mr functions as a wrapper, meaning it requires the underlying version control systems (e.g., Git, SVN) to be installed and correctly configured on your system for its respective repository types to function. Its effectiveness heavily depends on a well-structured and accurate .mrconfig file; errors in this configuration can lead to unexpected behavior or skipped repositories. When using parallel execution (-j), output from different repositories can be interleaved, which might make debugging or monitoring specific operations challenging.
CONFIGURATION FILE (<I>.MRCONFIG</I>)
The core of mr's functionality relies on its configuration file, typically located at ~/.mrconfig. This plain-text file defines each repository by specifying its path, type (e.g., git, svn), and optionally, specific commands or hooks to run. It can also define groups of repositories, allowing for operations on logical collections rather than individual ones. The file supports a simple, INI-like syntax, making it easy to define and manage a diverse set of repositories.
ACTIONS
While the parameters define how mr operates, actions define what mr does. Common actions include:
update: Update all repositories.
status: Show the status of all repositories.
run command: Execute an arbitrary command within each repository's directory.
commit: Commit changes in each repository.
diff: Show differences in each repository.
list: List configured repositories.
register: Add the current directory's repository to .mrconfig.
bootstrap: Check out missing repositories based on a configuration file.
HISTORY
mr, short for 'My Repositories', was developed by Joey Hess, a prominent Debian developer and creator of various robust command-line tools, including git-annex. Its inception around 2007-2008 was driven by Hess's personal need to manage an ever-increasing number of personal and project-related version control repositories, often using different VCS systems. The tool aimed to provide a unified, simple interface to streamline the daily developer workflow, moving beyond the tedium of navigating directories and remembering diverse VCS commands. Since its initial release, mr has been actively maintained and has become a valuable utility for many power users and developers managing diverse and numerous VCS projects.