如果我使用时间机器,为什么还要有版本控制系统?

时间:2022-07-20 06:50:43

I actually know that it's better to have an version control, but I wonder if Time Machine doesn't make a good job on this for lazy programmers?

我实际上知道有一个版本控制更好,但是我想知道Time Machine是否在懒惰程序员方面做得不好?

9 个解决方案

#1


Because TimeMachine won't track the log of file changes.

因为TimeMachine不会跟踪文件更改的日志。

e.g. for a given file in Subversion I can easily determine when it changed, and what else changed at the same time.

例如对于Subversion中的给定文件,我可以轻松确定它何时发生变化,以及同时发生了哪些变化。

It won't tell you who changed it, but I assume you're discussing single-user cases in this instance.

它不会告诉你谁更改了它,但我假设你正在讨论这个例子中的单用户案例。

And finally you can't tie checkins and changes to builds/deployments.

最后,您无法将签入和更改绑定到构建/部署。

Installing Subversion (or similar) on Mac OS is trivial, and won't consume resources unless you're checking in/out. It's strongly recommended. And of course make sure your repository is backed up with TimeMachine!

在Mac OS上安装Subversion(或类似版本)是微不足道的,除非您正在检入/退出,否则不会消耗资源。强烈推荐。当然,请确保使用TimeMachine备份您的存储库!

#2


They're actually very similar, but Time Machine doesn't keep track of what version of a file matches a particular build of the system. It's very useful to have the metadata.

它们实际上非常相似,但Time Machine无法跟踪文件的哪个版本与系统的特定版本匹配。拥有元数据非常有用。

#3


Time Machine does not keep all backups (it only keeps hourly backups for a day, and only keeps daily backups for a month), so you will not have every version of the file if you need to go back and figure out exactly what change introduced a problem. It doesn't have diff support built in, though you could probably do a diff -r on the directories in question. It also does not record any commit messages, which can be invaluable in figuring out why someone changed the code in a particular way. Finally, it does not help you coordinate between multiple people or one person on multiple computers; one of the biggest benefits of version control is that it helps you distribute your code and merge in changes from multiple people.

Time Machine不会保留所有备份(它只保留一天的每小时备份,并且只保留一个月的每日备份),因此如果您需要返回并确切知道所引入的更改,您将不会拥有该文件的每个版本一个问题。虽然你可能在有问题的目录上做一个diff -r,但它没有内置的diff支持。它也不记录任何提交消息,这对于弄清楚某人为何以特定方式更改代码非常有用。最后,它无法帮助您在多台计算机上协调多人或一人;版本控制的最大好处之一是它可以帮助您分发代码并合并来自多个人的更改。

If you want to have quick and easy version control, I'd recommend one of the distributed version control systems. Unlike centralized systems where you have to set up and administer a server, getting started with a distributed system is usually as easy as git init; git add .; git commit. I generally prefer Git, but Mercurial is also a good choice and some find it easier to get started with.

如果您想要快速简便的版本控制,我建议使用其中一个分布式版本控制系统。与您必须设置和管理服务器的集中式系统不同,使用分布式系统开始通常就像git init一样简单; git add。; git commit。我通常更喜欢Git,但Mercurial也是一个不错的选择,有些人发现它更容易上手。

#4


Time Machine will give you backups of your code. That's it.

Time Machine将为您提供代码备份。而已。

Source Control will give this as well, but provides a lot more as well. The biggest is branching and merging, which is a huge help on projects.

Source Control也会给出这个,但也提供了更多。最大的是分支和合并,这对项目有很大的帮助。

Time Machine also won't store metadata like checkin comments, or who made what changes.

Time Machine也不会存储像签入评论或进行了哪些更改的元数据。

Finally, Time Machine can't really be distributed. If you want someone else to start working on your code as well then Time Machine won't help. But (good) source control would make collaboration very easy.

最后,Time Machine无法真正分发。如果您希望其他人也开始处理您的代码,那么Time Machine将无济于事。但是(良好的)源代码控制会使协作变得非常容易。

#5


The single most important and valuable thing in a version control repository is not the content, it's not even the history (that's #2), it's the commit messages. And you don't have those in a backup program.

版本控制存储库中最重要且最有价值的东西不是内容,它甚至不是历史(即#2),而是提交消息。并且您没有备份程序中的那些。

#6


On the PC, active backup does pretty much the same thing, and also allows revision comparison albeit limited to file by file basis. The problem comes when you want to do something like list all the differences between version X and version Y, with the intention of building version Z based on a combination of the two. These type of backup systems are ok until you are simultaneously maintaining multiple versions of the same project.

在PC上,活动备份几乎完全相同,并且允许修订比较,尽管仅限于逐个文件。当您想要列出版本X和版本Y之间的所有差异之类的内容时,问题就出现了,目的是根据两者的组合构建版本Z.在同时维护同一项目的多个版本之前,这些类型的备份系统都可以。

#7


Branches & Tags?

分支机构和标签?

#8


For the reasons everybody else has pointed out, use source code control. It's easy to set up and will solve a lot of problems. It will tell you who changed what when, and why (if you use commit messages properly), and give you details. It's invaluable when you realize that something went wrong within the past few days.

由于其他人都指出的原因,使用源代码控制。它很容易设置并解决很多问题。它将告诉您谁更改了什么时间以及为什么(如果您正确使用提交消息),并提供详细信息。当你意识到过去几天出现问题时,这是非常宝贵的。

Once you've done that, use Time Machine to keep backups of the repository. A version control system is not a backup system. Nothing is safe that is only on one file system.

完成后,使用Time Machine保留存储库的备份。版本控制系统不是备份系统。没有什么是安全的,只能在一个文件系统上。

#9


dont forget about branching, it's one of most powerful tool a SCM can give you.. I dont know if time machine has some kind of 'alternate reality' feature

不要忘记分支,它是SCM可以给你的最强大的工具之一..我不知道时间机器是否具有某种“替代现实”功能

#1


Because TimeMachine won't track the log of file changes.

因为TimeMachine不会跟踪文件更改的日志。

e.g. for a given file in Subversion I can easily determine when it changed, and what else changed at the same time.

例如对于Subversion中的给定文件,我可以轻松确定它何时发生变化,以及同时发生了哪些变化。

It won't tell you who changed it, but I assume you're discussing single-user cases in this instance.

它不会告诉你谁更改了它,但我假设你正在讨论这个例子中的单用户案例。

And finally you can't tie checkins and changes to builds/deployments.

最后,您无法将签入和更改绑定到构建/部署。

Installing Subversion (or similar) on Mac OS is trivial, and won't consume resources unless you're checking in/out. It's strongly recommended. And of course make sure your repository is backed up with TimeMachine!

在Mac OS上安装Subversion(或类似版本)是微不足道的,除非您正在检入/退出,否则不会消耗资源。强烈推荐。当然,请确保使用TimeMachine备份您的存储库!

#2


They're actually very similar, but Time Machine doesn't keep track of what version of a file matches a particular build of the system. It's very useful to have the metadata.

它们实际上非常相似,但Time Machine无法跟踪文件的哪个版本与系统的特定版本匹配。拥有元数据非常有用。

#3


Time Machine does not keep all backups (it only keeps hourly backups for a day, and only keeps daily backups for a month), so you will not have every version of the file if you need to go back and figure out exactly what change introduced a problem. It doesn't have diff support built in, though you could probably do a diff -r on the directories in question. It also does not record any commit messages, which can be invaluable in figuring out why someone changed the code in a particular way. Finally, it does not help you coordinate between multiple people or one person on multiple computers; one of the biggest benefits of version control is that it helps you distribute your code and merge in changes from multiple people.

Time Machine不会保留所有备份(它只保留一天的每小时备份,并且只保留一个月的每日备份),因此如果您需要返回并确切知道所引入的更改,您将不会拥有该文件的每个版本一个问题。虽然你可能在有问题的目录上做一个diff -r,但它没有内置的diff支持。它也不记录任何提交消息,这对于弄清楚某人为何以特定方式更改代码非常有用。最后,它无法帮助您在多台计算机上协调多人或一人;版本控制的最大好处之一是它可以帮助您分发代码并合并来自多个人的更改。

If you want to have quick and easy version control, I'd recommend one of the distributed version control systems. Unlike centralized systems where you have to set up and administer a server, getting started with a distributed system is usually as easy as git init; git add .; git commit. I generally prefer Git, but Mercurial is also a good choice and some find it easier to get started with.

如果您想要快速简便的版本控制,我建议使用其中一个分布式版本控制系统。与您必须设置和管理服务器的集中式系统不同,使用分布式系统开始通常就像git init一样简单; git add。; git commit。我通常更喜欢Git,但Mercurial也是一个不错的选择,有些人发现它更容易上手。

#4


Time Machine will give you backups of your code. That's it.

Time Machine将为您提供代码备份。而已。

Source Control will give this as well, but provides a lot more as well. The biggest is branching and merging, which is a huge help on projects.

Source Control也会给出这个,但也提供了更多。最大的是分支和合并,这对项目有很大的帮助。

Time Machine also won't store metadata like checkin comments, or who made what changes.

Time Machine也不会存储像签入评论或进行了哪些更改的元数据。

Finally, Time Machine can't really be distributed. If you want someone else to start working on your code as well then Time Machine won't help. But (good) source control would make collaboration very easy.

最后,Time Machine无法真正分发。如果您希望其他人也开始处理您的代码,那么Time Machine将无济于事。但是(良好的)源代码控制会使协作变得非常容易。

#5


The single most important and valuable thing in a version control repository is not the content, it's not even the history (that's #2), it's the commit messages. And you don't have those in a backup program.

版本控制存储库中最重要且最有价值的东西不是内容,它甚至不是历史(即#2),而是提交消息。并且您没有备份程序中的那些。

#6


On the PC, active backup does pretty much the same thing, and also allows revision comparison albeit limited to file by file basis. The problem comes when you want to do something like list all the differences between version X and version Y, with the intention of building version Z based on a combination of the two. These type of backup systems are ok until you are simultaneously maintaining multiple versions of the same project.

在PC上,活动备份几乎完全相同,并且允许修订比较,尽管仅限于逐个文件。当您想要列出版本X和版本Y之间的所有差异之类的内容时,问题就出现了,目的是根据两者的组合构建版本Z.在同时维护同一项目的多个版本之前,这些类型的备份系统都可以。

#7


Branches & Tags?

分支机构和标签?

#8


For the reasons everybody else has pointed out, use source code control. It's easy to set up and will solve a lot of problems. It will tell you who changed what when, and why (if you use commit messages properly), and give you details. It's invaluable when you realize that something went wrong within the past few days.

由于其他人都指出的原因,使用源代码控制。它很容易设置并解决很多问题。它将告诉您谁更改了什么时间以及为什么(如果您正确使用提交消息),并提供详细信息。当你意识到过去几天出现问题时,这是非常宝贵的。

Once you've done that, use Time Machine to keep backups of the repository. A version control system is not a backup system. Nothing is safe that is only on one file system.

完成后,使用Time Machine保留存储库的备份。版本控制系统不是备份系统。没有什么是安全的,只能在一个文件系统上。

#9


dont forget about branching, it's one of most powerful tool a SCM can give you.. I dont know if time machine has some kind of 'alternate reality' feature

不要忘记分支,它是SCM可以给你的最强大的工具之一..我不知道时间机器是否具有某种“替代现实”功能