tags:

views:

239

answers:

5

I'm just starting out using Subversion on a C# project. I am working on this project alone, yet I'm trying to treat is as if I was working in a group for my own learning experience.

As I understand it the typical way of working with subversion is to have a trunk folder that will always build. Major changes are then create in new branches, which are then merged back into the trunk when they are complete. So there may be many simultaneous branches being worked on by different team members.

But if I'm working on my own is there any point to making a branch? Say I'm at revision 100 in HEAD. I'll create a branch at revision 101, and then keep working on the branch until Revision 110. Now I can merge 110 back into the trunk, but there is no one else on the project so there won't be any change in the trunk to merge back into. I'd just be merging right back into revision 100 where I original created the branch.

+4  A: 

Hello Eric,

I think branches should be used always you need do split the actual code from the base, for example when you need to try a far fetched solution for a problem or something. With branches you can separate the problems and the attempts of resolution and keep the version control.

Alex
+9  A: 

Branches have nothing to do with how many people are working on a project. A branch is for an alternate development stream, like different feature sets, hardware targets, or clients.

If 100 people are working on a single deliverable they should be using the same branch. If a single individual is supporting a dozen different deliverables he should have a dozen branches.

Dour High Arch
The way I was thinking about it would be that my trunk would always be a working version, and I would typical be working in a branch when I'm making major changes and breaking things. Being one person I don't have to worry about collaboration issues, but if I have no branches when I want to show someone the latest working version I have to remember to Update back to some specific revision number. If I work in a branch then I know I can always just take the latest revision at the trunk.
Eric Anastas
A: 

There doesn't seem too much point in creating branches if it's only you working on the project - you can just use the revisions after all to roll back to.

If, however you wanted to do something major and experimental and wanted to try a few things out then you could use the branch to isolate your changes and preserve the trunk.

You could work entirely out of trunk like this and then use release tags or branches for historical purposes... and other branches for experimental work.

Jon
+4  A: 

A branch (as opposed to tag) is a maintainable version of the code. Even as a single developer you may want to maintain more than one version of your code (e.g. migrating bugfixes to older releases).
SVN book lists the two most common use cases for SVN branches here.
Both methods' branching policies are not related directly to the number of developers in the project.
Unless you are working on a short term project (such as academic, single release, project) try to use one of these policies. The management overhead is low enough and it can make your life much easier later.

Oren S
A: 

I keep 2 branches: development and trunk because you never know when you have to do a quick fix on production. I may work on new features for 1-3 weeks before porting them to production. In the mean time, I may have to roll out fixes to production. By keeping 2 branches, I can easily deploy bug fixes only.

Julien