index > Team Foundation Server - General > Working on a different branch

Working on a different branch


Can someone advise me on the best way to work on a different branch?
Here is my scenario.

I have a main trunk and branch created off this trunk for a previous release.
I now want to work on the branch.
What is the best way of achieving this? Can it be done with workspaces?

Regards
Ian
Ian1971
You can map both branches into the same workspace, or use separate workspaces. It doesn't really matter.
Richard Berg MSFT
Richard Berg MSFT wrote:
You can map both branches into the same workspace, or use separate workspaces. It doesn't really matter.


I guess I'm not understanding workspaces correctly. I was thinking I could have two workspaces where in one the main trunk pointed at my c:\project\src folder and another workspace where the branch pointed at that same location so that I could switch between the two. Team Explorer doesn't let me do this though.
Ian1971
You could mimic the repository structure on your local drive and have the mappings in one workspace. That way, you can work on the branch separately to your main line and vice versa.



Joe Sango
Joe Sango
My initial thought was to mimic the repositry structure, but what I was hoping to avoid was having to set up a web application with a different name in IIS everytime I create a new branch, so that I could just have the one virtual root set up in IIS but switch the code to the branch as and when required. I was thinking of something similar to the Subversion "switch" command as described in this article http://blogs.vertigosoftware.com/teamsystem/archive/2006/01/18/Shelving_and_Branching.aspx

Ian1971

One way you could do this is to map that root directory under a drive letter and then map the branch to the new drive letter. This will effectively allow you to have two repository paths mapped to a single machine path. You'll have to deal with making sure you check-in, shelve without keeping changes etc. or be prepared for all the warnings about writable files.

I think Buck Hodges did a blog entry to this affect. Let me see if I can locate it...

On second thought... no I didn't read that in Buck's blog and it hit me as to why. It just won't work well (or at all any many many case) not only for the reasons I listed above but many things just don't work well (or at all) on mapped drives. One most significant is a web project which is exactly what you are discussing. I haven't tried a _Web Application_ project versus the original Visual Studio 2005 web project but either way....

I was wrong.

 




Principal Consultant, Magenic -- http://blogs.manicprogrammer.com/michaelruminer
Michael Ruminer
The best way I have found so far, is to do the following:
1) Unbind the Solution and all projects
2) Change the workspace to point at the branch
3) Rebind the solution and all projects choosing the branch location

Initially I thought I would only have to do 2), but I kept finding that Visual Studio was adding in the old workspace path when I tried to open the project. The unbind - bind seems to solve that.


Ian1971
If you do that (sounds dangerous...) make sure you run Get otherwise you won't actually be working on the correct files.
Richard Berg MSFT

Never thought about the bind issue. Good point. I too would have assumed number 2) alone would have worked. Can you tell I don't do much web development??

And, oh yes, all these workarounds are definately rife with ways to screw it up for yourself, as Richard aptly pointed out. A big mea culpa on that.




Principal Consultant, Magenic -- http://blogs.manicprogrammer.com/michaelruminer
Michael Ruminer
After thinking about it some more I have to recommend you not use the above steps. If the sln/project structure changes at all between the two branches you could really screw things up. Try this:

  1. File -> Close Solution
  2. Edit your workspace mappings
  3. Get Latest
  4. Reopen the solution from disk
Richard Berg MSFT
That seems to do the job. I just needed to close the solution first and do a get latest on the whole tree...can't imagine why I didn't close the solution anyway.

Thanks!
Ian
Ian1971
reply 11

You can use google to search for other answers

 

More Articles

Satellite Assemblies not available during unit test runs
TeamFoundationServerUnauthorizedException
The relationships of Area and Iterations
how can i check in the BIN folder from my class library project?
Incremental builds with Team Build
Can't receive alerts
Team Explorer doesn't support filenames with characters [ or ].
Permission denied when creating new team build
Cannot rename folders in Source Control
Project creation problem TFS Beta 3
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Red x on documents folder in team explorer
Testing for an running build
Maintain Process Guidance through Proces…
Source Control in Solution Explorer
Need means to automatically set one work…
getting changesets takes 30+ minutes
How to delete a Build Type?
Transfer TFS to another server?
Can I install Sql 2005 June Ctp with Tea…
Team build and project references!
Problem with the report site.
Source control for non.NET environment
Updating Assembly Version Information
Warehouse web service Server 500 error
Source Control acting weird

Hot Articles

Task gap - From Add Existing Team Projec…
TFS API: How can I get project portal URL?
Forgot password for TFSService
How to reference users and groups of a t…
Process Templates - Check-In Policy / Bu…
WSS Customization how to remove Process …
Allowing team members to create Team Bui…
Unit Testing VS Team Foundation Extensio…
mixed VSS/TFS source control deployment?
Create Query with calculation
Work Item "Assigned To" field …
Shortcut to see who did the build ?
Creating project bombs due to lack of ad…
Branch with Team Build?
h resolve /auto does not work, will it b…

Recommend Articles

Versions control - Branch & merge ve…
May I obtain RC without MSDN?
Team foundation error
TF82039: Team Foundation was unable to m…
TF30323: team project creation wizard fa…
Public TFS servers?
is it possible to prevent users from che…
Cannot connect to sites web service for …
Assigning multiple users to a task
Error 28905
Check-in policy of version control
Permissions Error.
Build and Alerts problem.
Source Code Storage
Upgrade path from TFS Trial to Full Vers…