Add command to sync an imported repository

It's now possible to keep in sync an imported repository with its
origin.

The lower-level functions accept also different branches and origins.