Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple copies of a solution on one user/machine with TFS 2010

Tags:

tfs

Is there a way to pull two copies of a single solution from TFS 2010 for the same user/machine?

like image 290
Brent Lamborn Avatar asked Feb 03 '11 14:02

Brent Lamborn


2 Answers

You can have multiple copies of a single solution either by having multiple branches in TFS or by setting up different workspaces.

The branches are good for when you need to be able to check in code for both copies of the solution, and have other people work with it too.

I use the multiple workspaces when I need to have a last good state of the code on my dev box while at the same time and still working on new features.

like image 142
Sean Lynch Avatar answered Nov 16 '22 03:11

Sean Lynch


Sean L's answer is correct.

My addition is that I coded up some command line calls to do it. Makes the "What exactly is going on here" stuff a little clearer, IMHO.

Put the below in .bat file. And save it to c:\ (anywhere you want)......if your BASEDIRECTORY is set to c:\ (somewhere) (or match the drive letters).

set __MYWORKSPACENAME=MySuperCoolNewWorkSpaceName001
set __BASEDIRECTORY=c:\tfsstuff\

MD %__BASEDIRECTORY%
CD %__BASEDIRECTORY%

set __tfExe=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe

"%__tfExe%" workspace /new %__MYWORKSPACENAME% /collection:http://myteamfoundationserver:8080/tfs/my_super_cool_projects /noprompt

"%__tfExe%" workfold /map $/MyBranch %__BASEDIRECTORY%\MyBranch


"%__tfExe%" get %__BASEDIRECTORY%\MyBranch\ /recursive /noprompt


set __BASEDIRECTORY=
set __MYWORKSPACENAME=
set __tfExe=
like image 45
granadaCoder Avatar answered Nov 16 '22 04:11

granadaCoder