Add Files to Version Control
If your team uses Visual Studio Team Foundation Server, you can add files from your local computer to version control. When the files are in version control, other members of your development team can access them to edit, build, and test their work locally.
Important
Before you can use version control in Team Foundation, you must have access to a team project. For more information, see Creating a Team Project.
You can add files from your local computer to version control by following the procedures in this topic. For information about how to add files by upgrading from a previous version of Team Foundation Server or by migrating from Visual SourceSafe, see Upgrading Team Foundation Server or Migrate from Visual SourceSafe.
Required Permissions
To perform these procedures, your Check out permissions must be set to Allow. For more information, see Team Foundation Server Permissions.
In this topic
To add a solution or project to version control
To create a solution and add it to version control
To add a file that is not in a solution to version control
To add a solution to version control
On your computer, make sure that the solution that you are adding is in a location that you want to use as a local working folder for that solution.
Note
The local working folder is where you will do your development work for that solution. For more information, see Create and Work With Workspaces.
Open Visual Studio, and connect to the team project to which you want to add the solution.
For more information, see Connect to and Access Team Projects in Team Foundation Server.
In Visual Studio, open your solution.
In Solution Explorer, right-click your solution, and then click Add Solution to Source Control.
The Add Solution to Source Control dialog box appears.
Under Team Project Location, specify the folder on the version-control server to which you want to add your solution.
In Type a name for the solution folder, type a name for the subfolder that will be created for your solution, and then click OK.
Note
At this point, the solution is scheduled to be added to version control pending a check-in operation.
To commit the addition of the solution to the server, in Solution Explorer, right-click your solution again, and then click Check In.
In the Check In dialog box, type an appropriate comment, such as Adding source files to version control, and then click Check In.
To create a solution and add it to version control
Open Visual Studio, and connect to your team project.
For more information, see Connect to and Access Team Projects in Team Foundation Server.
On the File menu, click New, and then click Project.
In the New Project dialog box, specify the type of project that you want to create and options for it.
In the Location list, specify the local working folder for the solution.
Note
The local working folder is where you will do your development work for that solution. For more information, see Create and Work With Workspaces.
Select the Add to source control check box, and then click OK.
The Add to source control dialog box appears.
Under Team Project Location, specify the folder on the version-control server to which you want to add the solution.
Under Type a name for the solution folder, type a name for the subfolder that will be created for your solution, and then click OK.
Note
At this point, the solution is scheduled to be added to version control pending a check-in operation.
To commit the addition of the solution to the server, in Solution Explorer, right-click your solution, and then click Check In.
In the Check In dialog box, type an appropriate comment, such as Adding source files to version control, and then click Check In.
To add a file that is not in a solution to version control
On your computer, make sure that the file that you are adding is in a location that you want to use as a local working folder for that file.
Note
The local working folder is where you will do your development work for that file. For more information, see Create and Work With Workspaces.
Open Visual Studio, and connect to your team project.
For more information, see Connect to and Access Team Projects in Team Foundation Server.
In Team Explorer, double-click Source Control.
In the Source Control window, specify the folder on the version-control server to which you want to add the file.
Tip
To display the list of folders in Source Control Explorer, click the Folders icon in the window’s task bar.
In Source Control Explorer, right-click the folder into which you want to add the file, and then click Add Items to Folder.
In the Add to Source Control dialog box, do one of the following:
If the folder is already mapped, click Finish.
If the folder is not mapped, click Map.
The Map dialog box appears.
In Local folder, make sure that the path is correct, and then click Map.
In the Add to Source Control dialog box, click Finish.
Note
At this point, the file is scheduled to be added to version control pending a check-in operation.
To commit the addition of the file to the server, in Solution Explorer, right-click the file, and then click Check In.
In the Check In dialog box, type an appropriate comment, such as Adding modeling diagram to version control, and then click Check In.
See Also
Tasks
Concepts
Connect to and Access Team Projects in Team Foundation Server