Mirror git repositories
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
- python (tested with python 3.5 but it probably works with former versions)
How to install
pip install gitbackup
python setup.py install
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)
Add repositories (a name of your choice followed by the URL)
gitbackup clone sametmax_0bin https://github.com/sametmax/0bin.git
gitbackup clone carl_backupchecker https://github.com/backupchecker/backupchecker.git
Some time later, let’s synchronize 0bin
gitbackup pull sametmax_0bin
Or all the repositories
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 email@example.com:mirror/bak_sametmax_0bin.git
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
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size gitbackup-0.1.1.tar.gz (16.3 kB)||File type Source||Python version None||Upload date||Hashes View|