Next: , Previous: Working Copy, Up: Command Reference



5.3 Network

monotone serve address collection
monotone pull [address [collection]]
monotone push [address [collection]]
monotone sync [address [collection]]
These commands operate the “netsync” protocol built into monotone. This is a custom protocol for rapidly synchronizing two monotone databases using a hash tree index. The protocol is “peer to peer”, but requires one peer to listen for incoming connections (the server) and the other peer (the client) to connect to the server.

The network address specified in each case should be the same: a host name to listen on, or connect to, optionally followed by a colon and a port number. The collection parameter indicates a set of branches to exchange; every branch for which collection is a prefix will be indexed and made available for synchronization.

For example, supposing Bob and Alice wish to synchronize their net.venge.monotone.win32 and net.venge.monotone.i18n branches. Supposing Alice's computer has hostname alice.someisp.com, then Alice might run:

          $ monotone serve alice.someisp.com net.venge.monotone
     

And Bob might run

          $ monotone sync alice.someisp.com net.venge.monotone
     

When the operation completes, all branches beginning with net.venge.monotone will be synchronized between Alice and Bob's databases.

The pull, push, and sync commands only require you pass address and collection the first time you use one of them; monotone will memorize this use and in the future default to the same server and collection. For instance, if Bob wants to sync with Alice again, he can simply run:

          $ monotone sync
     

Of course, he can still sync with other people and other branches by passing an address or address plus collection on the command line; this will not affect his default affinity for Alice. If you ever do want to change your defaults, use monotone unset database default-server or monotone unset database default-collection; these will clear your defaults, and cause them to be reset to the next person you netsync with.