Skip to main content

Mirror git repositories

Project description

Mirror git repositories!

This script is designed to backup a farm of git repositories in an automated fashion, it makes a local mirror that you can push on a remote.


Because a git repository can disappear, you may loose access to a source code, even if it’s Free/Libre. Large projects with a lot of developers can set up a new repository quickly if the former one is down. How about smaller projects? like this small piece of code you love so much but only a few are interested in?

The same way you backup your holiday pictures, copy your favorite FLOSS, because you have the right to do it! If github screws up, you’ll have your life vest.


What you need

  • git
  • python (tested with python 3.5 but it probably works with former versions)

How to install

With pip

pip install gitbackup


python install

On archlinux:


Fetch a local copy

Let’s start with a new sweet home

mkdir backup_github && cd backup_github

Initialize (create a .gitbackup directory that will contain a config file)

gitbackup init

Add repositories (a name of your choice followed by the URL)

gitbackup clone sametmax_0bin

gitbackup clone carl_backupchecker

Some time later, let’s synchronize 0bin

gitbackup pull sametmax_0bin

Or all the repositories

gitbackup pull

That’s it! Your local copy is updated. You can write a cron job :)

Push the copy to a remote

We can add a remote for some (or all!) repositories. For example:

gitbackup remote add sametmax_0bin

Once you pulled to sync your copy, you can push

gitbackup push sametmax_0bin

Or, you can push all repositories for which a remote has been configured

gitbackup push

Sync: pull and push

Similarly to the pull and push commands

gitbackup sync sametmax_0bin

Without name, gitbackup will pull all repositories and push those with a remote

gitbackup sync

Other commands

Move a mirror

gitbackup mv sametmax_0bin sametmax_0bin_source

Remove a remote

gitbackup remote rm sametmax_0bin

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gitbackup, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size gitbackup-0.1.2.tar.gz (17.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page