gpt4 book ai didi

Git 作为备份和版本控制系统

转载 作者:IT王子 更新时间:2023-10-29 01:26:44 26 4
gpt4 key购买 nike

我想使用 Git 来备份我的主硬盘,但我也想将它用作将存储在我的主硬盘中的项目的版本控制系统。

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

编辑:

好吧,我解释错了。我想拥有对我的主驱动器所做更改的历史记录,就像我可以使用 Git 一样,我也想备份它。

最佳答案

wrote a blog post about this不久前:

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.

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

关于Git 作为备份和版本控制系统,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2576198/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com