automirror - Automatically update a remote working tree upon commit

Version 0.1.0
Branch lp:bzr-automirror
Home page
Owner nmb
GNU/Linux Yes
Windows Yes
Mac OS X Yes

Automatically update another branch and working tree on commit.

This is a Bazaar ( plugin to “mirror” the current state of a project to another branch. The most common use case is to update a working tree that is on a webserver. There is substantial overlap between this plugin and the push-and-update plugin which updates a working tree of a remote branch after a push to that remote branch. (See for more information.)

This plugin is intended for use where the “official” version of a branch is not on the webserver (in which case, push-and-update would work). It also makes the mirroring process automatic on every commit.


To install the plugin, you need to put this directory under your Bazaar plugins folder (usually ~/.bazaar/plugins). An easy way to do that is to use Bazaar to branch this project right into that directory:

cd ~/.bazaar/plugins
bzr branch automirror


To enable mirroring, you need to add the post_commit_mirror configuration option on a branch. See bzr help configuration about ways this can be accomplished. The simplest is to add post_commit_mirror = <URL> to the .bzr/branch/branch.conf file, e.g.:

echo "post_commit_mirror = bzr+ssh://" >> .bzr/branch/branch.conf

Multiple branches may be specified for mirroring by separating the URLs with a comma. If, for some reason, the URL to mirror to contains a comma, then it must be encoded as “%44”.

Current Limitations

  • Mirroring currently only works on local paths or URLs that imply ssh access to the remote machine (sftp://, bzr+ssh:// or svn+ssh://).
  • Two separate connections are opened to the remote host. This may mean entering the same password twice.