我真的需要版本控制吗?

时间:2023-02-05 14:34:53

I read all over the Internet (various sites and blogs) about version control. How great it is and how all developers NEED to use it because it is very useful.

我阅读了有关版本控制的互联网(各种网站和博客)。它是多么伟大,以及所有开发人员如何使用它,因为它非常有用。

Here is the question: do I really need this? I'm a front-end developer (usually just HTML/CSS/JavaScript) and I NEVER had a problem like "Wow, my files from yesterday!". I've tried to use it, installed Subversion and TortoiseSVN, I understand the concept behind version control but... I can't use it (weird for me).

这是一个问题:我真的需要这个吗?我是一名前端开发人员(通常只是HTML / CSS / JavaScript),我从未遇到像“哇,我昨天的文件!”这样的问题。我已经尝试使用它,安装了Subversion和TortoiseSVN,我理解版本控制背后的概念,但是...我不能使用它(对我来说很奇怪)。

OK, so... Is that bad? I usually work alone (freelancer) and I had no client that asked me to use Subversion (but it never is too late for this, right?). So, should I start and struggle to learn to use Subversion (or something similar?) Or it's just a waste of time?

好的,那么......那很糟糕吗?我通常独自工作(*职业者),我没有客户要求我使用Subversion(但这对此来说永远不会太晚,对吧?)。那么,我应该开始并努力学习使用Subversion(或类似的东西?)或者这只是浪费时间?


Related question: Good excuses NOT to use version control.

相关问题:不使用版本控制的好借口。

30 个解决方案

#1


117  

Here's a scenario that may illustrate the usefulness of source control even if you work alone.

这是一个场景,可以说明源控制的有用性,即使你单独工作。

Your client asks you to implement an ambitious modification to the website. It'll take you a couple of weeks, and involve edits to many pages. You get to work.

您的客户要求您对网站实施雄心勃勃的修改。这将花费你几个星期,并涉及到许多页面的编辑。你开始工作了。

You're 50% done with this task when the client calls and tells you to drop what you're doing to make an urgent but more minor change to the site. You're not done with the larger task, so it's not ready to go live, and the client can't wait for the smaller change. But he also wants the minor change to be merged into your work for the larger change.

当客户致电并告诉您放弃正在进行的操作以对网站进行紧急但更微小的更改时,您已完成此任务的50%。你没有完成更大的任务,所以它还没有准备好上线,客户端不能等待较小的更改。但他也希望将微小的变化合并到你的工作中,以应对更大的变化。

Maybe you are working on the large task in a separate folder containing a copy of the website. Now you have to figure out how to do the minor change in a way that can be deployed quickly. You work furiously and get it done. The client calls back with further refinement requests. You do this too and deploy it. All is well.

也许您正在一个包含该网站副本的单独文件夹中处理大型任务。现在,您必须弄清楚如何以可以快速部署的方式进行微小更改。你疯狂地工作并完成它。客户端回调进一步的细化请求。你也这样做并部署它。一切都很好。

Now you have to merge it into the work in progress for the major change. What did you change for the urgent work? You were working too fast to keep notes. And you can't just diff the two directories easily now that both have changes relative to the baseline you started from.

现在,您必须将其合并到正在进行的主要更改工作中。你为紧急工作改变了什么?你工作得太快,无法记笔记。而且你现在不能简单地区分这两个目录,因为两者都有相对于你开始的基线的变化。

The above scenario shows that source control can be a great tool, even if you work solo.

上面的场景表明,即使你单独工作,源代码控制也是一个很好的工具。

  • You can use branches to work on longer-term tasks and then merge the branch back into the main line when it's done.
  • 您可以使用分支处理长期任务,然后在完成后将分支合并回主线。

  • You can compare whole sets of files to other branches or to past revisions to see what's different.
  • 您可以将整个文件集与其他分支或过去的修订进行比较,以查看不同的内容。

  • You can track work over time (which is great for reporting and invoicing by the way).
  • 您可以跟踪一段时间内的工作(顺便说一句,这对于报告和开发票非常有用)。

  • You can recover any revision of any file based on date or on a milestone that you defined.
  • 您可以根据日期或您定义的里程碑恢复任何文件的任何修订。

For solo work, Subversion or Git is recommended. Anyone is free to prefer one or the other, but either is clearly better than not using any version control. Good books are "Pragmatic Version Control using Subversion, 2nd Edition" by Mike Mason or "Pragmatic Version Control Using Git" by Travis Swicegood.

对于单独工作,建议使用Subversion或Git。任何人都可以*选择其中一个,但要么明显优于不使用任何版本控制。好书是由Mike Mason编写的“使用Subversion的第二版实用版本控制”或由Travis Swicegood编写的“使用Git的实用版本控制”。

#2


38  

There are lots of benefits, yes you need it.

有很多好处,是的,你需要它。

#3


33  

You don't need version control any more than a trapese artist needs a safety net. It's like backing up your hard drive—most of the time it seems redundant as nothing happens but it will be needed eventually. There's no maybes here. It will happen. And you can never predict when and the past is a poor indicator as to when it will happen. It may happen only once ever in the future but even if you know it'll happen once you won't know how bad it will be.

您不需要版本控制,只需要一个trapese艺术家需要一个安全网。这就像备份你的硬盘一样 - 大部分时间看似多余,因为没有任何反应,但最终还是需要它。这里没有maybes。它会发生。你永远无法预测何时和过去是何时会发生的糟糕指标。它可能只在未来发生一次,但即使你知道它会发生在你不知道它会有多糟糕的时候。

#4


11  

Yes!

Do it. It won't hurt you..

做吧它不会伤害你..

I usually switch from Laptop to PC and back and it's absolutely great to have your code somewhere in a central repository.

我通常从笔记本电脑切换到PC并返回,将代码放在*存储库中的位置非常棒。

Sometimes it's great to go just revert to the latest revision because you screwed up something that would be too difficult to fix..

有时候恢复到最新版本是很好的,因为你搞砸了一些难以修复的东西。

#5


5  

The biggest advantage that is missing is being able to re-produce the source code that generated an old build.

缺少的最大优势是能够重新生成生成旧构建的源代码。

At build time, you tag the source control with 'Build 4.26'. The next day you start coding Build 4.27. Three months later, when a client says, "I'm using Build 4.26, and there's a bug in the Frickershaw feature. I can't upgrade to any other build because of some changes to file formats you made in build 4.27. Is there anything you can do for me? I'm willing to pay."

在构建时,使用“Build 4.26”标记源代码控件。第二天你开始编译Build 4.27。三个月后,当一个客户端说:“我正在使用Build 4.26,并且Frickershaw功能中存在一个错误。由于您在构建4.27中对文件格式进行了一些更改,我无法升级到任何其他版本。是否存在你能为我做点什么吗?我愿意付钱。“

Then, you can checkout a branch of the 4.26 source code... fix the Frickershaw feature, and then re-build the package for the user in about an hour or two. Then you can switch back to version 4.39, and keep working.

然后,您可以签出4.26源代码的分支...修复Frickershaw功能,然后在大约一两个小时内为用户重新构建包。然后您可以切换回版本4.39,并继续工作。

In the same vein, you can track down the exact point at which a bug was added. Test versions 4.25 for the bug, then 4.20, then 4.10 and eventually find the bug was introduced in version 4.12. Then you look for all changes made between 'Build 4.11' and 'Build 4.12', and then focus on the Frickershaw feature. You can quickly find the source code for the bug without ever debugging it.

同样,您可以追踪添加错误的确切位置。为bug测试版本4.25,然后是4.20,然后是4.10,最终发现版本4.12中引入了bug。然后,您将查找“Build 4.11”和“Build 4.12”之间所做的所有更改,然后关注Frickershaw功能。您无需调试就可以快速找到错误的源代码。

#6


4  

Branching doesn't seem useful to you? Have you never wanted to just try something out to see if it would work? I do a lot of plain old html/css stuff too, and I find that invaluable. There is literally no danger in branching to test something, seeing if it works, and deciding "meh" and then just rolling back.

分支似乎对你没用?你有没有想过尝试一下看看它是否有效?我也做了很多普通的旧html / css的东西,我发现它非常宝贵。分支测试某些东西,看它是否有效,并决定“meh”然后回滚,实际上没有任何危险。

I've never needed to get to a backup (knock on wood), but I find just the rolling back functionality invaluable.

我从来不需要备份(敲木头),但我发现回滚功能非常宝贵。

#7


4  

A few perks as a freelancer:

作为*职业者的一些好处:

  • Know definitively what you changed in every single file and when (as long as you check in often)
  • 明确了解您在每个文件中更改的内容以及何时更改(只要您经常办理登机手续)

  • Rollback to any version in your past. Surprising how often this is valuable.
  • 回滚到过去的任何版本。令人惊讶的是,这是多么有价值。

  • Track a set of changes as a 'release'. This way you know what each client is currently using and what's in development.
  • 将一组更改作为“发布”进行跟踪。通过这种方式,您可以了解每个客户端当前使用的内容以及正在开发的内容。

  • Backup
  • The ability to easily share a project if you suddenly aren't solo
  • 如果您突然不单独,轻松分享项目的能力

#8


4  

Try a DVCS like Git or Bazaar. They are incredibly easy to set up, easy to use, and offer all the important features of Subversion, CVS, etc.

尝试像Git或Bazaar这样的DVCS。它们非常易于设置,易于使用,并提供Subversion,CVS等所有重要功能。

The key is that you can revert back to a working version when you break something, which is often much faster than undoing the change manually.

关键是你可以在破坏时恢复到工作版本,这通常比手动撤消更改要快得多。

#9


3  

I wouldn't hire a contractor without them integrating into our processes. They would have to access code via our SVN, and would be unlikely to get paid without meeting unit testing and code review requirements.

如果没有他们整合到我们的流程中,我就不会聘请承包商。他们必须通过我们的SVN访问代码,如果没有满足单元测试和代码审查要求,则不太可能获得报酬。

If contracting I'd make sure to have solid experience of both VSS (check-in/out) and CVS (merge & conflict) models.

如果签约,我一定要有VSS(签到/退出)和CVS(合并和冲突)模型的可靠经验。

Working on your own you have a great opportunity to play and learn with the latest - I'd be trying out Git.

独自工作,你有一个很好的机会来玩和学习最新的 - 我会尝试Git。

As a lone developer you can think of source control as an unlimited undo - one that works across sessions and reboots.

作为一个单独的开发人员,您可以将源代码控制视为无限制的撤销 - 跨会话和重新启动。

#10


3  

A minor advantage of source control for me is that I work on multiple development computers. It is easy to move my work around between machines.

源代码控制的一个小优点是我在多台开发计算机上工作。在机器之间移动我的工作很容易。

The greatest advantage in my opinion has already been listed. It allows me to sleep at night knowing that if we have to roll-back a change it will be fairly easy.

我认为最大的优势已经列出。它允许我在晚上睡觉,知道如果我们必须回滚更改它将是相当容易的。

#11


3  

I think the main advantage in moving from a "keep-all-versions file system" to a source code control system lies in the fact that the sccs adds structure to all those versions you kept of all those files, and provides you with records of "what was the consistent state of the whole file system at point X".

我认为从“保持所有版本的文件系统”迁移到源代码控制系统的主要优势在于,sccs为所有这些文件添加了所有这些文件的结构,并为您提供了“X点整个文件系统的一致状态是什么”。

In other words, "Which version of file A goes with which versions of B, C, D, ...".

换句话说,“哪个版本的文件A与哪个版本的B,C,D,......”相关。

And an afterthought (¡!): the special act of committing or checking in makes you think about "what is this?", and the resulting log message can, hopefully, serve as memory...

事后的想法(¡!):提交或检查的特殊行为让你想到“这是什么?”,并且结果日志信息可以作为记忆......

#12


3  

The literal answer to this question is, No, you do not NEED version control.

这个问题的字面答案是,不,你不需要版本控制。

You do, however, WANT version control, even if you don't know it.

但是,即使您不知道,也可以使用WANT版本控制。


That said, many SCM tools can be mysterious or downright unpleasant to use until you break through the Grok Barrier, so let's revise that a bit:

也就是说,在你突破Grok Barrier之前,许多SCM工具可能会让人感到神秘或彻底不愉快,所以让我们稍微修改一下:

"You do, however, want EASY-TO-USE version control." And it's out there...download a bunch of recommended visual clients and give them a whirl, then try whichever maps best to the way you think.

“但是,你确实需要易于使用的版本控制。”它就在那里......下载一堆推荐的视觉客户端并给它们一个旋转,然后尝试最适合你想象的方式。

Which leads to the question you meant to ask:

这导致你要问的问题:

Why do I want to use version control?"

为什么我要使用版本控制?“

Answer: Version control allows you to be FEARLESS!

答:版本控制可以让你无所畏惧!

#13


2  

Yes you need it.

是的,你需要它。

At the very least, for a single developer shop, you need to move code into a ProjectName-Date-Time directory several times a day.

至少,对于单个开发人员商店,您需要每天多次将代码移动到ProjectName-Date-Time目录中。

That is, write a script that will automatically back up your working directory at lunch and at quitting time, without overwriting other back ups.

也就是说,编写一个脚本,它将在午餐和退出时自动备份您的工作目录,而不会覆盖其他备份。

This can grow pretty fast, so eventually you'll want to save only the differences between files, which is what a VC application does.

这可以快速增长,所以最终你只想保存文件之间的差异,这是VC应用程序的作用。

#14


2  

Since you usually work alone, I would say that it is a good idea to use version control. One of the main benefits I have found in using version control (Subversion in my case), is that when working alone it gives me more confidence in trying a new approach to the problem. You can always branch to a new method or framework of solving the problem and see if you like it better. If it turns out that this branch doesn't work, you can just abandon it and go back to the old method. This also makes it easier to try out the different solutions side by side.

由于您通常独自工作,我会说使用版本控制是个好主意。我在使用版本控制(在我的情况下是Subversion)中发现的一个主要好处是,当单独工作时,它让我更有信心尝试新的方法来解决问题。您可以随时分支到解决问题的新方法或框架,看看您是否更喜欢它。如果事实证明这个分支不起作用,你可以放弃它并返回旧方法。这也使得更容易并排尝试不同的解决方案。

So, if you have ever seen a different approach to solving a problem and you wanted to try it out, I would definitely use version control as a tool to make this easier.

所以,如果你曾经见过一种解决问题的不同方法而你想尝试一下,我肯定会使用版本控制作为一种工具来使这更容易。

#15


1  

If you are working on your own, and are performing backups on a regular basis, VC may not be needed (unless you count your backups as version history). As soon as you start working with another developer, you should get version control in place so that you don't start over-writing each other's work.

如果您自己工作,并且定期执行备份,则可能不需要VC(除非您将备份计为版本历史记录)。一旦你开始与另一个开发人员合作,你应该得到版本控制,这样你就不会开始过度编写彼此的工作。

#16


1  

Even if you don't need it right now, it is something you will need whenever you work in a team.

即使您现在不需要它,也是您在团队中工作时需要的东西。

#17


1  

Having a history of changes to your html/css/javascript can be a godsend. Being able to compare your front-end to the code a month, or several months ago can really go a long way in figuring out why suddenly the template is all askew.

拥有html / css / javascript更改历史可能是一个天赐之物。能够在一个月或几个月前比较你的前端和代码,确实可以很长时间地弄清楚为什么突然模板都是歪斜的。

Plus if you ever want/need to get help on your project(s), you'll have an easy system to distribute, track, and deploy updated content.

此外,如果您希望/需要获得项目帮助,您将拥有一个简单的系统来分发,跟踪和部署更新的内容。

Definitely do it, you'll thank yourself once you get used to it.

一定要这样做,一旦你习惯了,你会感谢你自己。

Checkout (one time) Update (beginning of day) Commit (end of task/change after testing)

结帐(一次)更新(一天开始)提交(任务结束/测试后更改)

That's all there is to it. Don't commit EVERY single modification that you're refreshing in the browser, just the one's you want to go live.

这里的所有都是它的。不要提交您在浏览器中刷新的每一个修改,只需要您想要的实时修改。

#18


1  

Think if it like a backup. It is a little irritating until the day you need it. Then the amount of work you lose is directly proportional to the frequency of your backups.

想想它是否像备份一样。直到你需要的那一天,它有点刺激。然后,您丢失的工作量与备份频率成正比。

Another benifit is being able to look at old ways you did things that may have become obsolete in a certain spot but could be usefull in another. Just cut and paste the old code that you got when doing a compare.

另一个好处是能够看到你在某个地方可能已经过时但在另一个地方可能有用的东西。只需剪切并粘贴进行比较时得到的旧代码。

That is unless you like reinventing the wheel you already reinvented...

除非你喜欢重新发明你已经重新发明的*,否则...

#19


1  

When things can go wrong they will. It is very nice to have the ability to reference code you may have deleted a month ago, or to recover the entire project after a hardware failure or upgrade.

当事情出错时,他们会。能够引用一个月前可能已删除的代码,或者在硬件故障或升级后恢复整个项目,这是非常好的。

There may also be a point in the future when the project is worked on by more than you. The ability to prevent (or control) branching and versioning is a must in an environment like that.

未来可能还有一点,项目的工作比你更多。在这样的环境中,必须具备防止(或控制)分支和版本控制的能力。

#20


1  

Must must must must must must. You must use version control.

必须必须必须。您必须使用版本控制。

This is of the deepest importance.

这是最重要的。

If you don't understand why now, you will one day.

如果你现在不明白为什么,你有一天会。

#21


1  

When your client phones up in a panic because something is broken on the live site and it's a regression, you'll be glad you can just open TortoiseSVN and see what it was you did last Tuesday that caused the breakage.

当你的客户惊慌失措,因为现场网站上的某些东西被打破而且它是一个回归,你会很高兴你可以打开TortoiseSVN,看看你上周二做了什么导致了破损。

#22


1  

It's really odd. Ever since I started using version control, I've very occasionally had the need to look up old copies of my code and use them. I never needed to do this before...probably because the idea of doing didn't really stick. It's easy not to notice those times when you could have found version control helpful.

这真的很奇怪。自从我开始使用版本控制以来,我偶尔需要查找我的代码的旧副本并使用它们。我之前从未需要这样做...可能是因为做的想法并没有真正坚持下去。当您发现版本控制有用时,很容易不会注意到那些时候。

#23


1  

Search within an entire codebase. It's a killer feature, mainly because the search gets actioned on another machine so you can get on with your work undisturbed.

在整个代码库中搜索。这是一个杀手级功能,主要是因为搜索在另一台机器上进行操作,因此您可以不受干扰地继续工作。

Which incidentally, is the reason why we didn't change to SourceGear Vault. It can't do this. We're still looking for a SourceSafe-compatible replacement for... well, SourceSafe. Despite what everyone says, it hasn't let us down yet*

顺便说一句,这就是为什么我们没有更改为SourceGear Vault的原因。它不能这样做。我们仍然在寻找与SourceSafe兼容的替代品......好吧,SourceSafe。尽管每个人都说,它还没有让我们失望*

* this may just be a matter of time.

*这可能只是时间问题。

#24


0  

I think you've made the right decision to use some kind of version control. For simplicity, I'd go with SVN (ignore CVS as SVN is basically a "better" CVS)

我认为您已经做出了使用某种版本控制的正确决定。为简单起见,我会选择SVN(忽略CVS,因为SVN基本上是一个“更好”的CVS)

SVN can work with "local" repositories right on the filesystem and on lots of platform so you don't have to bite off too much in infrastructure (servers, networks, etc)

SVN可以在文件系统和许多平台上使用“本地”存储库,因此您不必在基础结构(服务器,网络等)中咬掉太多东西

Great resource for SVN: http://svnbook.red-bean.com

SVN的重要资源:http://svnbook.red-bean.com

I don't know much about GIT, but it being open source and gain lots of mindshare probably has alot of similar advantages!

我对GIT知之甚少,但它是开源的,获得大量的思想共享可能有很多类似的优势!

Borrowing a quote from somewhere: You might not need it now, but when you do, you'll be glad you did.

从某个地方借用一句话:你现在可能不需要它,但是当你这样做时,你会很高兴你做到了。

Happy versioning!

#25


0  

Although old and crude, we have found Microsoft Visual SourceSafe to work. It works great for keeping version history. If you are not to worried about branching, which being the solo developer you may not, it might just fit the bill.

虽然旧的和粗糙的,我们发现Microsoft Visual SourceSafe工作。它非常适合保存版本历史记录。如果你不担心分支,你可能不是单独的开发者,它可能只是适合账单。

As far as checking in, finding a good checkpoint can be a challenge, but checking in on every save will only make versioning hard to track.

在办理登机手续时,找到一个好的检查站可能是一个挑战,但检查每次保存只会使版本难以跟踪。

#26


0  

"Do I really need version control?"

“我真的需要版本控制吗?”

Yes. Unless you write perfect code that never needs to get changed.

是。除非你写出永远不需要改变的完美代码。

An example: I had a requirement. I built up a webpage, spent a day or so on the page, it's Section 508 compatibility (this was about 6-7 years ago), and uploaded to the website. Next the requirement was changed drastically. I spend another day working on the page (and Hayuge Excel files didn't convert into accessible HTML easily). About a week later, client switches asks that we go back to Version A. Source control would have done this in about 10 minutes. As it was, I had to blow another %$#^^&$# day on the task.

一个例子:我有一个要求。我建立了一个网页,花了一天左右的时间在页面上,它的Section 508兼容性(这是大约6 - 7年前),并上传到网站。接下来,要求发生了巨大变化。我花了一天时间在页面上工作(并且Hayuge Excel文件没有轻易转换为可访问的HTML)。大约一周后,客户端交换机要求我们返回版本A.源控制将在大约10分钟内完成。事实上,我不得不在这个任务上再吹一个%$#^^和$#天。

#27


0  

Yes, you need version control either for development purposes or simply for storing your documents. This way, you can go back in time if you're required to do so in order to revert changes or mistake made on a code or documents.

是的,您需要版本控制用于开发目的或仅用于存储文档。这样,如果您需要这样做,您可以及时返回,以便还原对代码或文档所做的更改或错误。

#28


0  

Once you start working on a team that references ever upgrading "components" from multiple callers/applications, version control will be an absolute must. In that environment, there is no way that you can keep up with all the permutations of possible change.

一旦你开始在一个团队中工作,该团队引用了来自多个调用者/应用程序的不断升级的“组件”,那么版本控制将是绝对必要的。在那种环境中,你无法跟上可能发生变化的所有排列。

#29


0  

You need version control just like you need insurance in life.

您需要版本控制,就像您需要保险一样。

#30


0  

You need version control to manage different file versions. With it, you can get and work on the files from different places and it facilitates team members to collaborate on the same project.

您需要版本控制来管理不同的文件版本。有了它,您可以从不同的地方获取和处理文件,这有助于团队成员在同一个项目上进行协作。

#1


117  

Here's a scenario that may illustrate the usefulness of source control even if you work alone.

这是一个场景,可以说明源控制的有用性,即使你单独工作。

Your client asks you to implement an ambitious modification to the website. It'll take you a couple of weeks, and involve edits to many pages. You get to work.

您的客户要求您对网站实施雄心勃勃的修改。这将花费你几个星期,并涉及到许多页面的编辑。你开始工作了。

You're 50% done with this task when the client calls and tells you to drop what you're doing to make an urgent but more minor change to the site. You're not done with the larger task, so it's not ready to go live, and the client can't wait for the smaller change. But he also wants the minor change to be merged into your work for the larger change.

当客户致电并告诉您放弃正在进行的操作以对网站进行紧急但更微小的更改时,您已完成此任务的50%。你没有完成更大的任务,所以它还没有准备好上线,客户端不能等待较小的更改。但他也希望将微小的变化合并到你的工作中,以应对更大的变化。

Maybe you are working on the large task in a separate folder containing a copy of the website. Now you have to figure out how to do the minor change in a way that can be deployed quickly. You work furiously and get it done. The client calls back with further refinement requests. You do this too and deploy it. All is well.

也许您正在一个包含该网站副本的单独文件夹中处理大型任务。现在,您必须弄清楚如何以可以快速部署的方式进行微小更改。你疯狂地工作并完成它。客户端回调进一步的细化请求。你也这样做并部署它。一切都很好。

Now you have to merge it into the work in progress for the major change. What did you change for the urgent work? You were working too fast to keep notes. And you can't just diff the two directories easily now that both have changes relative to the baseline you started from.

现在,您必须将其合并到正在进行的主要更改工作中。你为紧急工作改变了什么?你工作得太快,无法记笔记。而且你现在不能简单地区分这两个目录,因为两者都有相对于你开始的基线的变化。

The above scenario shows that source control can be a great tool, even if you work solo.

上面的场景表明,即使你单独工作,源代码控制也是一个很好的工具。

  • You can use branches to work on longer-term tasks and then merge the branch back into the main line when it's done.
  • 您可以使用分支处理长期任务,然后在完成后将分支合并回主线。

  • You can compare whole sets of files to other branches or to past revisions to see what's different.
  • 您可以将整个文件集与其他分支或过去的修订进行比较,以查看不同的内容。

  • You can track work over time (which is great for reporting and invoicing by the way).
  • 您可以跟踪一段时间内的工作(顺便说一句,这对于报告和开发票非常有用)。

  • You can recover any revision of any file based on date or on a milestone that you defined.
  • 您可以根据日期或您定义的里程碑恢复任何文件的任何修订。

For solo work, Subversion or Git is recommended. Anyone is free to prefer one or the other, but either is clearly better than not using any version control. Good books are "Pragmatic Version Control using Subversion, 2nd Edition" by Mike Mason or "Pragmatic Version Control Using Git" by Travis Swicegood.

对于单独工作,建议使用Subversion或Git。任何人都可以*选择其中一个,但要么明显优于不使用任何版本控制。好书是由Mike Mason编写的“使用Subversion的第二版实用版本控制”或由Travis Swicegood编写的“使用Git的实用版本控制”。

#2


38  

There are lots of benefits, yes you need it.

有很多好处,是的,你需要它。

#3


33  

You don't need version control any more than a trapese artist needs a safety net. It's like backing up your hard drive—most of the time it seems redundant as nothing happens but it will be needed eventually. There's no maybes here. It will happen. And you can never predict when and the past is a poor indicator as to when it will happen. It may happen only once ever in the future but even if you know it'll happen once you won't know how bad it will be.

您不需要版本控制,只需要一个trapese艺术家需要一个安全网。这就像备份你的硬盘一样 - 大部分时间看似多余,因为没有任何反应,但最终还是需要它。这里没有maybes。它会发生。你永远无法预测何时和过去是何时会发生的糟糕指标。它可能只在未来发生一次,但即使你知道它会发生在你不知道它会有多糟糕的时候。

#4


11  

Yes!

Do it. It won't hurt you..

做吧它不会伤害你..

I usually switch from Laptop to PC and back and it's absolutely great to have your code somewhere in a central repository.

我通常从笔记本电脑切换到PC并返回,将代码放在*存储库中的位置非常棒。

Sometimes it's great to go just revert to the latest revision because you screwed up something that would be too difficult to fix..

有时候恢复到最新版本是很好的,因为你搞砸了一些难以修复的东西。

#5


5  

The biggest advantage that is missing is being able to re-produce the source code that generated an old build.

缺少的最大优势是能够重新生成生成旧构建的源代码。

At build time, you tag the source control with 'Build 4.26'. The next day you start coding Build 4.27. Three months later, when a client says, "I'm using Build 4.26, and there's a bug in the Frickershaw feature. I can't upgrade to any other build because of some changes to file formats you made in build 4.27. Is there anything you can do for me? I'm willing to pay."

在构建时,使用“Build 4.26”标记源代码控件。第二天你开始编译Build 4.27。三个月后,当一个客户端说:“我正在使用Build 4.26,并且Frickershaw功能中存在一个错误。由于您在构建4.27中对文件格式进行了一些更改,我无法升级到任何其他版本。是否存在你能为我做点什么吗?我愿意付钱。“

Then, you can checkout a branch of the 4.26 source code... fix the Frickershaw feature, and then re-build the package for the user in about an hour or two. Then you can switch back to version 4.39, and keep working.

然后,您可以签出4.26源代码的分支...修复Frickershaw功能,然后在大约一两个小时内为用户重新构建包。然后您可以切换回版本4.39,并继续工作。

In the same vein, you can track down the exact point at which a bug was added. Test versions 4.25 for the bug, then 4.20, then 4.10 and eventually find the bug was introduced in version 4.12. Then you look for all changes made between 'Build 4.11' and 'Build 4.12', and then focus on the Frickershaw feature. You can quickly find the source code for the bug without ever debugging it.

同样,您可以追踪添加错误的确切位置。为bug测试版本4.25,然后是4.20,然后是4.10,最终发现版本4.12中引入了bug。然后,您将查找“Build 4.11”和“Build 4.12”之间所做的所有更改,然后关注Frickershaw功能。您无需调试就可以快速找到错误的源代码。

#6


4  

Branching doesn't seem useful to you? Have you never wanted to just try something out to see if it would work? I do a lot of plain old html/css stuff too, and I find that invaluable. There is literally no danger in branching to test something, seeing if it works, and deciding "meh" and then just rolling back.

分支似乎对你没用?你有没有想过尝试一下看看它是否有效?我也做了很多普通的旧html / css的东西,我发现它非常宝贵。分支测试某些东西,看它是否有效,并决定“meh”然后回滚,实际上没有任何危险。

I've never needed to get to a backup (knock on wood), but I find just the rolling back functionality invaluable.

我从来不需要备份(敲木头),但我发现回滚功能非常宝贵。

#7


4  

A few perks as a freelancer:

作为*职业者的一些好处:

  • Know definitively what you changed in every single file and when (as long as you check in often)
  • 明确了解您在每个文件中更改的内容以及何时更改(只要您经常办理登机手续)

  • Rollback to any version in your past. Surprising how often this is valuable.
  • 回滚到过去的任何版本。令人惊讶的是,这是多么有价值。

  • Track a set of changes as a 'release'. This way you know what each client is currently using and what's in development.
  • 将一组更改作为“发布”进行跟踪。通过这种方式,您可以了解每个客户端当前使用的内容以及正在开发的内容。

  • Backup
  • The ability to easily share a project if you suddenly aren't solo
  • 如果您突然不单独,轻松分享项目的能力

#8


4  

Try a DVCS like Git or Bazaar. They are incredibly easy to set up, easy to use, and offer all the important features of Subversion, CVS, etc.

尝试像Git或Bazaar这样的DVCS。它们非常易于设置,易于使用,并提供Subversion,CVS等所有重要功能。

The key is that you can revert back to a working version when you break something, which is often much faster than undoing the change manually.

关键是你可以在破坏时恢复到工作版本,这通常比手动撤消更改要快得多。

#9


3  

I wouldn't hire a contractor without them integrating into our processes. They would have to access code via our SVN, and would be unlikely to get paid without meeting unit testing and code review requirements.

如果没有他们整合到我们的流程中,我就不会聘请承包商。他们必须通过我们的SVN访问代码,如果没有满足单元测试和代码审查要求,则不太可能获得报酬。

If contracting I'd make sure to have solid experience of both VSS (check-in/out) and CVS (merge & conflict) models.

如果签约,我一定要有VSS(签到/退出)和CVS(合并和冲突)模型的可靠经验。

Working on your own you have a great opportunity to play and learn with the latest - I'd be trying out Git.

独自工作,你有一个很好的机会来玩和学习最新的 - 我会尝试Git。

As a lone developer you can think of source control as an unlimited undo - one that works across sessions and reboots.

作为一个单独的开发人员,您可以将源代码控制视为无限制的撤销 - 跨会话和重新启动。

#10


3  

A minor advantage of source control for me is that I work on multiple development computers. It is easy to move my work around between machines.

源代码控制的一个小优点是我在多台开发计算机上工作。在机器之间移动我的工作很容易。

The greatest advantage in my opinion has already been listed. It allows me to sleep at night knowing that if we have to roll-back a change it will be fairly easy.

我认为最大的优势已经列出。它允许我在晚上睡觉,知道如果我们必须回滚更改它将是相当容易的。

#11


3  

I think the main advantage in moving from a "keep-all-versions file system" to a source code control system lies in the fact that the sccs adds structure to all those versions you kept of all those files, and provides you with records of "what was the consistent state of the whole file system at point X".

我认为从“保持所有版本的文件系统”迁移到源代码控制系统的主要优势在于,sccs为所有这些文件添加了所有这些文件的结构,并为您提供了“X点整个文件系统的一致状态是什么”。

In other words, "Which version of file A goes with which versions of B, C, D, ...".

换句话说,“哪个版本的文件A与哪个版本的B,C,D,......”相关。

And an afterthought (¡!): the special act of committing or checking in makes you think about "what is this?", and the resulting log message can, hopefully, serve as memory...

事后的想法(¡!):提交或检查的特殊行为让你想到“这是什么?”,并且结果日志信息可以作为记忆......

#12


3  

The literal answer to this question is, No, you do not NEED version control.

这个问题的字面答案是,不,你不需要版本控制。

You do, however, WANT version control, even if you don't know it.

但是,即使您不知道,也可以使用WANT版本控制。


That said, many SCM tools can be mysterious or downright unpleasant to use until you break through the Grok Barrier, so let's revise that a bit:

也就是说,在你突破Grok Barrier之前,许多SCM工具可能会让人感到神秘或彻底不愉快,所以让我们稍微修改一下:

"You do, however, want EASY-TO-USE version control." And it's out there...download a bunch of recommended visual clients and give them a whirl, then try whichever maps best to the way you think.

“但是,你确实需要易于使用的版本控制。”它就在那里......下载一堆推荐的视觉客户端并给它们一个旋转,然后尝试最适合你想象的方式。

Which leads to the question you meant to ask:

这导致你要问的问题:

Why do I want to use version control?"

为什么我要使用版本控制?“

Answer: Version control allows you to be FEARLESS!

答:版本控制可以让你无所畏惧!

#13


2  

Yes you need it.

是的,你需要它。

At the very least, for a single developer shop, you need to move code into a ProjectName-Date-Time directory several times a day.

至少,对于单个开发人员商店,您需要每天多次将代码移动到ProjectName-Date-Time目录中。

That is, write a script that will automatically back up your working directory at lunch and at quitting time, without overwriting other back ups.

也就是说,编写一个脚本,它将在午餐和退出时自动备份您的工作目录,而不会覆盖其他备份。

This can grow pretty fast, so eventually you'll want to save only the differences between files, which is what a VC application does.

这可以快速增长,所以最终你只想保存文件之间的差异,这是VC应用程序的作用。

#14


2  

Since you usually work alone, I would say that it is a good idea to use version control. One of the main benefits I have found in using version control (Subversion in my case), is that when working alone it gives me more confidence in trying a new approach to the problem. You can always branch to a new method or framework of solving the problem and see if you like it better. If it turns out that this branch doesn't work, you can just abandon it and go back to the old method. This also makes it easier to try out the different solutions side by side.

由于您通常独自工作,我会说使用版本控制是个好主意。我在使用版本控制(在我的情况下是Subversion)中发现的一个主要好处是,当单独工作时,它让我更有信心尝试新的方法来解决问题。您可以随时分支到解决问题的新方法或框架,看看您是否更喜欢它。如果事实证明这个分支不起作用,你可以放弃它并返回旧方法。这也使得更容易并排尝试不同的解决方案。

So, if you have ever seen a different approach to solving a problem and you wanted to try it out, I would definitely use version control as a tool to make this easier.

所以,如果你曾经见过一种解决问题的不同方法而你想尝试一下,我肯定会使用版本控制作为一种工具来使这更容易。

#15


1  

If you are working on your own, and are performing backups on a regular basis, VC may not be needed (unless you count your backups as version history). As soon as you start working with another developer, you should get version control in place so that you don't start over-writing each other's work.

如果您自己工作,并且定期执行备份,则可能不需要VC(除非您将备份计为版本历史记录)。一旦你开始与另一个开发人员合作,你应该得到版本控制,这样你就不会开始过度编写彼此的工作。

#16


1  

Even if you don't need it right now, it is something you will need whenever you work in a team.

即使您现在不需要它,也是您在团队中工作时需要的东西。

#17


1  

Having a history of changes to your html/css/javascript can be a godsend. Being able to compare your front-end to the code a month, or several months ago can really go a long way in figuring out why suddenly the template is all askew.

拥有html / css / javascript更改历史可能是一个天赐之物。能够在一个月或几个月前比较你的前端和代码,确实可以很长时间地弄清楚为什么突然模板都是歪斜的。

Plus if you ever want/need to get help on your project(s), you'll have an easy system to distribute, track, and deploy updated content.

此外,如果您希望/需要获得项目帮助,您将拥有一个简单的系统来分发,跟踪和部署更新的内容。

Definitely do it, you'll thank yourself once you get used to it.

一定要这样做,一旦你习惯了,你会感谢你自己。

Checkout (one time) Update (beginning of day) Commit (end of task/change after testing)

结帐(一次)更新(一天开始)提交(任务结束/测试后更改)

That's all there is to it. Don't commit EVERY single modification that you're refreshing in the browser, just the one's you want to go live.

这里的所有都是它的。不要提交您在浏览器中刷新的每一个修改,只需要您想要的实时修改。

#18


1  

Think if it like a backup. It is a little irritating until the day you need it. Then the amount of work you lose is directly proportional to the frequency of your backups.

想想它是否像备份一样。直到你需要的那一天,它有点刺激。然后,您丢失的工作量与备份频率成正比。

Another benifit is being able to look at old ways you did things that may have become obsolete in a certain spot but could be usefull in another. Just cut and paste the old code that you got when doing a compare.

另一个好处是能够看到你在某个地方可能已经过时但在另一个地方可能有用的东西。只需剪切并粘贴进行比较时得到的旧代码。

That is unless you like reinventing the wheel you already reinvented...

除非你喜欢重新发明你已经重新发明的*,否则...

#19


1  

When things can go wrong they will. It is very nice to have the ability to reference code you may have deleted a month ago, or to recover the entire project after a hardware failure or upgrade.

当事情出错时,他们会。能够引用一个月前可能已删除的代码,或者在硬件故障或升级后恢复整个项目,这是非常好的。

There may also be a point in the future when the project is worked on by more than you. The ability to prevent (or control) branching and versioning is a must in an environment like that.

未来可能还有一点,项目的工作比你更多。在这样的环境中,必须具备防止(或控制)分支和版本控制的能力。

#20


1  

Must must must must must must. You must use version control.

必须必须必须。您必须使用版本控制。

This is of the deepest importance.

这是最重要的。

If you don't understand why now, you will one day.

如果你现在不明白为什么,你有一天会。

#21


1  

When your client phones up in a panic because something is broken on the live site and it's a regression, you'll be glad you can just open TortoiseSVN and see what it was you did last Tuesday that caused the breakage.

当你的客户惊慌失措,因为现场网站上的某些东西被打破而且它是一个回归,你会很高兴你可以打开TortoiseSVN,看看你上周二做了什么导致了破损。

#22


1  

It's really odd. Ever since I started using version control, I've very occasionally had the need to look up old copies of my code and use them. I never needed to do this before...probably because the idea of doing didn't really stick. It's easy not to notice those times when you could have found version control helpful.

这真的很奇怪。自从我开始使用版本控制以来,我偶尔需要查找我的代码的旧副本并使用它们。我之前从未需要这样做...可能是因为做的想法并没有真正坚持下去。当您发现版本控制有用时,很容易不会注意到那些时候。

#23


1  

Search within an entire codebase. It's a killer feature, mainly because the search gets actioned on another machine so you can get on with your work undisturbed.

在整个代码库中搜索。这是一个杀手级功能,主要是因为搜索在另一台机器上进行操作,因此您可以不受干扰地继续工作。

Which incidentally, is the reason why we didn't change to SourceGear Vault. It can't do this. We're still looking for a SourceSafe-compatible replacement for... well, SourceSafe. Despite what everyone says, it hasn't let us down yet*

顺便说一句,这就是为什么我们没有更改为SourceGear Vault的原因。它不能这样做。我们仍然在寻找与SourceSafe兼容的替代品......好吧,SourceSafe。尽管每个人都说,它还没有让我们失望*

* this may just be a matter of time.

*这可能只是时间问题。

#24


0  

I think you've made the right decision to use some kind of version control. For simplicity, I'd go with SVN (ignore CVS as SVN is basically a "better" CVS)

我认为您已经做出了使用某种版本控制的正确决定。为简单起见,我会选择SVN(忽略CVS,因为SVN基本上是一个“更好”的CVS)

SVN can work with "local" repositories right on the filesystem and on lots of platform so you don't have to bite off too much in infrastructure (servers, networks, etc)

SVN可以在文件系统和许多平台上使用“本地”存储库,因此您不必在基础结构(服务器,网络等)中咬掉太多东西

Great resource for SVN: http://svnbook.red-bean.com

SVN的重要资源:http://svnbook.red-bean.com

I don't know much about GIT, but it being open source and gain lots of mindshare probably has alot of similar advantages!

我对GIT知之甚少,但它是开源的,获得大量的思想共享可能有很多类似的优势!

Borrowing a quote from somewhere: You might not need it now, but when you do, you'll be glad you did.

从某个地方借用一句话:你现在可能不需要它,但是当你这样做时,你会很高兴你做到了。

Happy versioning!

#25


0  

Although old and crude, we have found Microsoft Visual SourceSafe to work. It works great for keeping version history. If you are not to worried about branching, which being the solo developer you may not, it might just fit the bill.

虽然旧的和粗糙的,我们发现Microsoft Visual SourceSafe工作。它非常适合保存版本历史记录。如果你不担心分支,你可能不是单独的开发者,它可能只是适合账单。

As far as checking in, finding a good checkpoint can be a challenge, but checking in on every save will only make versioning hard to track.

在办理登机手续时,找到一个好的检查站可能是一个挑战,但检查每次保存只会使版本难以跟踪。

#26


0  

"Do I really need version control?"

“我真的需要版本控制吗?”

Yes. Unless you write perfect code that never needs to get changed.

是。除非你写出永远不需要改变的完美代码。

An example: I had a requirement. I built up a webpage, spent a day or so on the page, it's Section 508 compatibility (this was about 6-7 years ago), and uploaded to the website. Next the requirement was changed drastically. I spend another day working on the page (and Hayuge Excel files didn't convert into accessible HTML easily). About a week later, client switches asks that we go back to Version A. Source control would have done this in about 10 minutes. As it was, I had to blow another %$#^^&$# day on the task.

一个例子:我有一个要求。我建立了一个网页,花了一天左右的时间在页面上,它的Section 508兼容性(这是大约6 - 7年前),并上传到网站。接下来,要求发生了巨大变化。我花了一天时间在页面上工作(并且Hayuge Excel文件没有轻易转换为可访问的HTML)。大约一周后,客户端交换机要求我们返回版本A.源控制将在大约10分钟内完成。事实上,我不得不在这个任务上再吹一个%$#^^和$#天。

#27


0  

Yes, you need version control either for development purposes or simply for storing your documents. This way, you can go back in time if you're required to do so in order to revert changes or mistake made on a code or documents.

是的,您需要版本控制用于开发目的或仅用于存储文档。这样,如果您需要这样做,您可以及时返回,以便还原对代码或文档所做的更改或错误。

#28


0  

Once you start working on a team that references ever upgrading "components" from multiple callers/applications, version control will be an absolute must. In that environment, there is no way that you can keep up with all the permutations of possible change.

一旦你开始在一个团队中工作,该团队引用了来自多个调用者/应用程序的不断升级的“组件”,那么版本控制将是绝对必要的。在那种环境中,你无法跟上可能发生变化的所有排列。

#29


0  

You need version control just like you need insurance in life.

您需要版本控制,就像您需要保险一样。

#30


0  

You need version control to manage different file versions. With it, you can get and work on the files from different places and it facilitates team members to collaborate on the same project.

您需要版本控制来管理不同的文件版本。有了它,您可以从不同的地方获取和处理文件,这有助于团队成员在同一个项目上进行协作。