How to: Copy a Source-controlled Item

You can copy a project from one source-controlled solution to another, or copy a file from one source-controlled project to another. When you copy an item, a new branch is created in the database, together with the item's history and other metadata. This branching allows for your team to develop two versions of a product at the same time and independently.

Note

If you copy a source-controlled project to a solution that is not under source control, the project will not be branched.

To copy a source-controlled project

  1. In Visual Studio, open Solution Explorer.

  2. Right-click the destination solution in Solution Explorer.

  3. On the drop-down menu, click Add, and then click Existing Project.

  4. In the Add Existing Project dialog box, click the name of the source control plug-in.

  5. Double-click the database that contains the project you want to copy.

  6. Select the project, and click Open.

  7. Click OK.

To copy a source-controlled file

  1. In Visual Studio, open Solution Explorer.

  2. Right-click the destination project in Solution Explorer. This project must be in the same database as the source project.

  3. On the drop-down menu, click Add, and then click Existing Item.

  4. In the Add Existing Item dialog box, click the name of the source control plug-in.

  5. Double-click the database that contains the file that you want to copy.

  6. Select the file, and then click Add.

  7. Click OK.

See Also

Reference

Add Existing Item Dialog Box

Other Resources

Performing Source Control Tasks