gitsync is a tool that allows you to sync a git repository’s remotes. It was designed to allow me to sync public
repositories to a private CI system without having to manually check for changes and mirror them to the internal CI system.
It can sync multiple branches per remote pair, and can be run inside and outside of a current working directory that contains a git repository.
It is designed to be defensive at startup, checking as much state as it can to make sure the sync operation can proceed.
It is NOT designed to be run inside a working tree that you’re hacking on. Setup the repo on disk somewhere with your remote pairs and then leave it alone, so it can cleanly fast forward from the source and push that cleanly into the target.
It checks out each branch before syncing it, in order to pull any changes.
gitsync.conf for an example configuration.
gitsync uses the excellent go-git golang git library.
-helpprint usage help
-configconfig file path (defaults to
-debugprint debug information to stdout
-insecureallow reading an insecure config file
-repodirpath to the git repository checkout you want to sync (defaults to
-versionprint version and build information and exit