Do I really need version control? [closed]

2019-01-03 12:29发布

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).

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?


Related question: Good excuses NOT to use version control.

30条回答
太酷不给撩
2楼-- · 2019-01-03 13:11

"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.

查看更多
趁早两清
3楼-- · 2019-01-03 13:11

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.

查看更多
爷的心禁止访问
4楼-- · 2019-01-03 13:13

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.


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:

"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!

查看更多
放我归山
5楼-- · 2019-01-03 13:13

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.

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.

查看更多
不美不萌又怎样
6楼-- · 2019-01-03 13:14

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.

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.

查看更多
爱情/是我丢掉的垃圾
7楼-- · 2019-01-03 13:14

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.

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

查看更多
登录 后发表回答