Search code examples
visual-studio-2013tfsazure-devopssource-control-explorer

How do I add the source code to a TFS project in Visual Studio 2013?


I've got projects added to TFS in Visual Studio, with some help from here.

Now I need to add the source code (which has already been mapped, which I would think would be all that was necessary), but the project ("Report Runner") does not show the code (as "RoboReporterDataFilesGeneratorUtil" does, but I don't recall now how I got that to work).

This is what I see when I right-click "Report Runner"

enter image description here

When I select "Get Latest Version" says that all files are up-to-date

When I select "Check Out for Edit..." it seems to churn and choogle awhile, but even a refresh shows no addition to the contents below Report Runner

When I select "Check In Pending Changes", I see this below Team Explorer:

enter image description here

Selecting the "Check In" button invokes a dialog "Continue to check-in 5 items?"

Selecting "Yes" results in the following message below "Pending Changes" in Team Explorer:

"All of the changes were either unmodified files or locks. The changes have been undone by the server."

When I select "Advanced > Get Specific Version", I see this:

enter image description here

...but selecting "Get" there tells me, "All files are up to date. No files were updated... To force an update, use the "Get Specific Version" command with the "Overwrite all..." option checked."

But even doing that works no wonders, miracles, or even anything at all, mundane or otherwise.

So how do I add the source code from the local project so that it displays in Source Control Explorer?

UPDATE

I dragged (drug?) the source folder to C:\Users\cshannon\Source\Workspaces\ReportRunner, but failed to COPY it; it moved it, so that the source was no longer in its original place. I had to copy it back over from the users folder to its original location. However, that makes no difference - the current state of the TFS project is still exactly the same as delineated above.

NOTE: It does so "move" (rather than copy) in the official docs here.


Solution

  • You need to "Add the files to Source Control".

    You can do this by:

    1. Opening the Solution in Visual Studio, then right-clicking on the solution and selecting "Add Solution to Source Control" - This will miss any files that are not part of the solution.
    2. Open Seouce Explorer, navigate to the mapped folder, and right-click in the empty space and select "Add files"

    The #2 is the preferred option and will get all of the files in. Look out for files that you want to be check in ending up in the "exclusions" list...