Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git for important file backup - why not? [closed]

Tags:

git

backup

Say I want to use Git to back up my PC.

I don't care about a full system backup. I don't mind having to reinstall things if my hard drive crashes. I just want to back up my data files, which are all on one partition.

To back up with Git, I could create a repo on that partiion, clone it (bare) on a separate drive or system, and periodically commit and push to back up my files.

What, if any, are the drawbacks to using Git for backup in this way?

like image 945
Ryan Lundy Avatar asked Aug 10 '11 01:08

Ryan Lundy


People also ask

Is git good for backup?

git bundle is can be used for backup purposes. It will create a single file containing all the refs you need to export from your local repository. For one branch, it's simple. This command will create a myrepo.

Do I need to backup GitHub?

Backups help prevent lost work, but they also ensure your data is always accessible. Having a complete copy of your repository (saved externally) protects you from relying on external services, i.e. GitHub. After all, no service can guarantee 100% uptime.

How do I backup a branch?

To do this you need three steps: Make an empty backup repository on the external backup disk; Point your current git repository at the backup repository with git remote add ; Send the changes to the backup repository with git push .


1 Answers

Git repository takes as much space as every version of your files, compressed. If you're planning to archive precompressed data like photos, be prepared for enormous .git growth.

As of 2011 Git does not use binary diffs like, for example, Subversion, and stores binary files as they are, compressed.

If you're short of disk space consider using other, more efficient in terms of disk space usage, specialized backup solutions. Borg, attic, restic, duplicity, zbackup come to mind.

like image 180
sanmai Avatar answered Sep 28 '22 17:09

sanmai