Share via


Adding Individual Files to Source-Code Control

Home Page (Source-Code Control)OverviewHow Do I ... Topics

You can set Visual C++ options to prompt you automatically each time you insert files into your project, or you can choose explicitly to put them under source-code control.

To prompt automatically for inclusion under source-code control

  1. From the Tools menu, choose Options.

  2. Click the Source Control tab.

  3. Select the Prompt To Add Files When Inserted check box.

  4. Click OK.

    Now, each time you insert files into the project, Visual C++ prompts you to add the inserted files to your source-code control system.

If some or all of the files currently included in your project are not under source-code control, you can add them individually to the source-code control system.

Note   Files listed in the External Dependencies folder in FileView are not part of the project, but are needed to build the project. These files will not show up in any source-code control dialog boxes unless they are added to the project. To add a file to the project, simply drag it from the External Dependencies folder into any of the project folders.

To add individual files to source-code control

  1. In the FileView pane of the Project Workspace window, select the files that you want to put under source-code control.

  2. From the Project menu, choose Source Control, and then choose Add To Source Control from the drop-down menu.

    The Add To Source Control dialog box appears, with checks in the Files list next to the files that you have selected. The list includes all files in the project directory that are not already under source-code control, and you may check or uncheck any files in the list.

  3. In the Comment text box, type a comment about the files, if you want.

  4. Click OK.

    The files are now under source-code control, and the file icons in the FileView pane are now grayed to indicate this.