且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Rsyncing git repo足够好的备份解决方案吗?

更新时间:2023-02-05 22:23:56

rsync 是一个很好的解决方案。在执行备份之前运行 git gc git repack (不带任何参数)可能是个好主意。这可能会显着减少文件数量,并增加下次数据不会发生太大变化的机会。也不会丢失任何数据。



请参阅 http://sethrobertson.github .com / GitBestPractices /#备份,以便说明为什么使用git来做这件事不是一个好的解决方案。


I often backup my laptop to an external hard drive. Is rsyncing git repos over good enough backup solution or are there any problems with this method?

rsync is a good solution for this. It may be a good idea to run git gc and git repack (neither with any arguments) before doing your backup; this may significantly reduce the number of files, and increase the chance of the data not changing too much by next time. Neither will lose any data.

See http://sethrobertson.github.com/GitBestPractices/#backups for a write-up of why doing this with git isn't such a good solution.