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

£可爱£侵袭症+ 提交于 2019-12-10 13:21:56

问题


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?


回答1:


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.




回答2:


It's a pretty decent solution, and much better than nothing. Dead simple too, if you're familiar with git.

One downside is that history will be kept forever; there's no easy way to roll off older, stale versions of files, or even to thin older versions. For example, you might like to discard everything older than 3 years, and anything older than a year you only want monthly snapshots. So your backup will continuously grow until it consumes your entire disk.



来源:https://stackoverflow.com/questions/7004904/git-for-important-file-backup-why-not

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!