Back to tutorial index

Sync repositories

For instructors/lab managers:
you might need to sync the global or regional repository with a local intermediate repository. In my case, being instructor in two labs (WeMake and Opendot) I need to sync their repositories (on GitHub) with the Europe repository.

Script

The process of syncing is never fully automatized, since there are many potential errors to check. I've tried to automatize as much as possible with a Python script but, at the same time, giving a feedback to the user on the updated files and the size of the folders, and by asking twice if everything is ok and the script can proceed. If there is any error, the script will halt and give you feedback. The script sync multiple Git repositories with a Mercurial repository, but you can modify path and structure for your local needs.