Reputation: 3523
I am kind of new to SVN, I haven't used it in detail basically just checking out trunk and committing then exporting and deploying.
I am working on a big project now with several developers and we are looking for the best deployment process. The one thing we are hung up on is the best way to tag, branch and so on. We are used to CVS where all you have to do is commit a file and tag it as production ready and if not that code will not get deployed.
I see that SVN handles tagging differently then CVS. I figure I am looking at this and making it overly complex. It seems the only way to work on a project and commit files without it being in the production code is to do it in a branch and then merge those changes when you are ready for it to be deployed. I am assuming you could also be working on other code that should be deployed so you would have to be switching between working copies, because otherwise you are working on a branch that isn't getting mixed in with the trunk or production branch?
This process seems overly complex and I was wondering if anyone could give me what you think is the best process for managing this.
Upvotes: 1
Views: 352
Reputation: 6425
There are two schools of thought for working with SVN (and most other centralized VCS):
Stable Trunk - The trunk is where all of your good stable code is. Only safe "single work-unit" changes are done to the trunk. All of your development is done in branches and then merged to the trunk. When it is release time, you tag from the trunk.
Unstable Trunk - The trunk is your "bleeding edge". All the new stuff gets committed to the trunk. When your work starts to gel into a release, you make a branch where you can work on stabilizing and polishing everything. You'll end up with a branch for each release (branches/v1.0, branches/v1.1, etc). You tag from the release branch when it is ready.
Notes about Model #1:
Notes about Model #2:
I have seen both models work very well. It depends on how the team works and how the codebase is structured.
Upvotes: 2
Reputation: 499062
the only way to work on a project and commit files without it being in the production code is to do it in a branch and then merge those changes when you are ready for it to be deployed.
Absolutely correct. This is the way to work with SVN, TFS and most modern source control management systems.
The normal workflow is to have a TRUNK branch which is as close to production as possible, and a Main branch, which the work is done on - for large features you create sub branches from your Main branch.
There are distributed SCMs, such as Git and Mercurial that do not work this way, but chances are you will find them even more complex than SVN.
See this blog post on one branching strategy (A SVN branching strategy that works).
Here is another (Simple branching and merging with SVN).
Upvotes: 0
Reputation: 6605
we do the following and are very happy with it:
i have a projects folder into which i checkout the trunk, the last few release-branches and the feature branch(es) i'm currently working on. that way i can easily commit and merge between different branches.
two more helpful rules:
Upvotes: 2
Reputation: 17525
What the best process is depends on a number of factors. How big are your changes, what kind are they (bug-fixes, new features), how many developers do you have?
In general I would suggest to use branches for big new features or large refactorings that might affect the entire software. Small bugfixes or really small features, that don't affect other parts might be developed on the trunk.
But the main uneasiness you seem to have might be resolved by actually using two trunks. One for the current development/testing version and one for the current stable version. Then you can merge the changes from development to stable before deploying them. In the end this is more or less like another branch common to all developers.
Fortunately subversion lets you do any of this without any problems.
The best source for more information might be the SVN Book
Upvotes: 0