Git作为备份和版本控制系统 [英] Git as a backup and Version Control System

查看:201
本文介绍了Git作为备份和版本控制系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用Git来备份我的家庭硬盘,但我也想把它作为一个版本控制系统用于存储在我的家庭硬盘上的项目。



<我会怎么做呢?是否.gitignore所有项目的根文件夹并为它们创建新的存储库?



编辑:

好的,我解释了我错误的想法。我想有一个我的家庭驱动器的变化历史记录,就像我可以用Git获得的一样,并且我也想要支持它。 解决方案

写了一篇博客发布这篇文章一段时间后:


版本控制系统,可能除SourceSafe外,都非常适合跟踪码。这是为什么?因为它们被设计用来跟踪代码。



不幸的是,一个好的VCS的功能完全不同 em> - 而且经常完全相反 - 构成一个好备份系统的功能。



例如,文件所有权。一个好的VCS会非常正确地忽略文件所有权:当我检查别人的代码时,我应该是这些文件的所有者 - 而不是最初创建它们的任何uid。另一方面,一个好的备份系统将完全保留文件所有权:当我从备份中恢复时,我希望/ etc / shaddow被root和/ home / wolever /归wolever所有。


但是,如果您真的想要,请查看 bup - 据我所知,它用 git right进行备份。


I want to use Git to backup my home drive, but I also want to use it as a version control system for projects that will be stored in my home drive.

How would I go about doing that? Do I .gitignore all the projects root folders and make new repositories for them?

Edit:

Ok I explained what I wanted wrongly. I want to have a history of changes made to my home drive like I can get with Git and I also want to back that up.

解决方案

I wrote a blog post about this a while back:

Version control systems, with the possible exception of SourceSafe, are great at keeping track of code. Why is that? Because they were designed to keep track of code.

Unfortunately, though, the features of a good VCS are entirely different – and often exactly the opposite – of the features which make a good backup system.

Take, for example, file ownership. A good VCS will, very rightly, ignore file ownership: when I check out someone else's code, I should be the owner of those file - not whatever uid originally created them. A good backup system, on the other hand, will do everything in its power to preserve file ownership: when I restore from my backups, I want /etc/shaddow to be owned by root and /home/wolever/ to be owned by wolever.

BUT, if you really want to, check out bup - as far as I can tell, it does backup with git "right".

这篇关于Git作为备份和版本控制系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆