Is rsyncing git repo a good enough backup solution?

I often back up my laptop to an external hard drive. Is rsyncing git repos a good enough fallback solution or is there any problem with this method?

+7
source share
3 answers

rsync is a good solution for this. It might be nice to run git gc and git repack (with no arguments) before backing up; this can significantly reduce the number of files and increase the likelihood that the data will not change too much next time. Nothing to lose.

See http://sethrobertson.github.com/GitBestPractices/#backups for a description of why doing this with git is not such a good solution.

+6
source

rsync is interesting if you really want to backup everything (including hooks and personal files).
But:

  • it does not guarantee the integrity of your repo after synchronization (i.e. git still working with rsync repo?)
  • it has a higher chance of data corruption (you need to save a lot of files)

A nicer (and cleaner) solution would be to use git bundle (which is essentially a repo bar, seen as a single file).
You upgrade your local package and save rsync on your remote media.
In addition, this time you only "rsync" (in fact a simple copy is enough) one file .
And you can directly clone or extract from this one file, this package.

+2
source

I have a repo, I continue hosting, which I click on. If I want to work somewhere, I clone it, push the changes when it's done.

You could also rsync, but it was easier for me to clone the repo and then use it as my main girl. I think using one tool may be easier, but your mileage may vary.

0
source

All Articles