Add an existing folder to TFS source control

Visual Studio-2010TfsTeam Explorer

Visual Studio-2010 Problem Overview


Is there any way I can add an existing folder to source control in TFS? I have created a new folder outside of TFS, just in the file system, and would like to add it to source control, but the only apparent way to do this is the ridiculous workaround of renaming my new folder to a temp name, then creating the new folder in Source Control Explorer, then adding the items from my renamed, original new folder.

Visual Studio-2010 Solutions


Solution 1 - Visual Studio-2010

Just select the folder after selecting the "Add Items to Folder..." option. You can get to this is from the context menu you get when right clicking on a folder (either the name or the actual folder itself).

The next page of the wizard will present you with lists of included and excluded files. Select the files you want and then hit "Finish".

Then submit the pending changes.

Solution 2 - Visual Studio-2010

Let me share you a easier way that I just figured out. (I was having the same trouble, and that is why I found this post.)

Drag the folder you want to add to the solution explorer and drop at the place you want to add.

Ta Ta ! It is done.

Mine is VS2010.

Solution 3 - Visual Studio-2010

Before dragging and dropping or selecting Add Items To Folder, you must map the parent TFS folder to your local drive.

That is, if you want to add a C:\Stuff\HelloWorld directory to the /Top/Projects folder in TFS, you must first map /Top/Projects to C:\Stuff and then add HelloWorld.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionProfKView Question on Stackoverflow
Solution 1 - Visual Studio-2010ChrisFView Answer on Stackoverflow
Solution 2 - Visual Studio-2010maxisamView Answer on Stackoverflow
Solution 3 - Visual Studio-2010IanView Answer on Stackoverflow