Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preferred Version Control Methodology

I am a novice in the world of source/version control and I have been doing as much reading as physically possible to get my head around the different techniques that people use for their own source/version control.

One thing that I have noticed is a pretty distinct break in the methods of developers into two (possibly more?) groups: one group prefers to keep their trunk in an always-stable state and performs all maintenance and future development in the branches, while others prefer to do all of their development in the trunk and keep it in a not-so-stable state.

I am curious as to what the community here at StackOverflow prefers or if you have your own methods.

Note: If it would help tailor the answers, I should note that I am a single developer (at most there would be two or three others in the same project) who works primarily in ASP.NET and SQL Server 2005

like image 624
TheTXI Avatar asked Jan 20 '09 03:01

TheTXI


People also ask

What are the three types of version control?

The types of VCS are: Local Version Control System. Centralized Version Control System. Distributed Version Control System.

What are two approaches to version control?

There are two types of version control: centralized and distributed.

What is a popular version control system?

Without a doubt, Git is the single most popular version control system in use. Not only does Git offer the strongest feature set for developers, but it also has the most reliable workflow and is supported by the most third-party platforms on the market.

Is Git better than SVN?

SVN is better than Git for architecture performance, binary files, and usability. And it may be better for access control and auditability, based on your needs.


1 Answers

As I'm sure you've noticed from searching the web for answers on this topic, this is one of those things where the best answer is "It depends.", and as most of the responses have indicated, it's a trade-off between how easy do you want to be able to commit/merge new code vs. managing an extensive version history that you can easily roll back for support or debugging purposes.

I work for a small company, which means that at any given time, we could have 3 or 4 different versions of code on developer machines that have not yet been committed to the repository. We use TortoiseSVN for our version control system, which gives us the ability to branch/merge without too much difficulty, as well as being able to view the update log or revert our local copies to an earlier revision pretty easily.

Based on your question, I suppose we would fall under the group of developers who attempts to keep, at all times, a stable Trunk, and we branch new code and test it before merging it back into the Trunk. We also make an effort to keep "snapshots" of each version release so that, if necessary, we can easily check out an earlier version and re-build it, without incorporating any new features intended for a future release (This is also a great mechanism for tracking down bugs, as you can use earlier versions of code to help determine when a particular bug was first introduced into your code. However, one thing to be careful of is if your application references common code that is maintained separately from your version-ed code, you will need to keep track of that too!).

On the repository, it ends up looking something like this:

  • Trunk

    • v1.0.1.x Release
    • v1.0.2.x Release

      • v1.0.2.x Bug-Fix A <-- (These get merged back into Trunk, but remain on the repo)
      • v1.0.2.x Bug-Fix B
    • v1.1.1.x Release

    • v1.2.1.x Development <-- (This will get merged back to Trunk, and replaced by a Release folder)

      • v1.2.1.x New Feature A <-- (These get merged back into the Development branch)
      • v1.2.1.x New Feature B

When I first started at the company, our version structure was not quite as sophisticated, and in my experience, I would say that if you have any need whatsoever to keep track of earlier versions, it is will worth the effort to put something like this together (like I said earlier, it doesn't have to look exactly like this, so long as it fits your individual needs), keep it well documented so that all contributors can maintain it (the alternative is that the creator ends up "babysitting" the repo, which quickly becomes an incredible waste of time), and encourage all your developers to follow it. It may feel like a lot of effort in the beginning, but you'll appreciate it the first time you need to take advantage of it.

Good luck!

like image 180
jeremyalan Avatar answered Oct 16 '22 22:10

jeremyalan