51
votes

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.

3

3 Answers

52
votes

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.

22
votes

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.

4
votes

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.