Adding Files to Source Control—Team Foundation Server

When working in a project that is connected to source control, there may be occasions when you have files in your local copy of the project that are not yet part of the source control copy. For example, when you add a new topic in your local copy of the project, that file will not be included in the source control copy of the project until you add it. 

How to Add Files to Source Control

  1. Do one of the following, depending on the part of the user interface you are using:
    • Ribbon Select Source Control > Add.

    • Right-Click If you have the Content Explorer, Project Organizer, Pending Changes window pane, or File List open, right-click the file you want to add and select Source Control > Add.

    The Check In dialog opens. The selected files are listed with check boxes next to them.

  2. (Optional) Enter an optional comment tied to the check-in. This enables you to keep an audit trail for a file. The comment can then be viewed from the History dialog, which can be accessed from the Source Control Explorer, the Source Control ribbon, the File menu, or the Source Control button .
  3. (Optional) If you want to see all files with pending changes (rather than only those you selected), click .
  4. Make sure to click the check box next to each file you want to check in so that it contains a check mark.
  5. If you want to automatically check the files out of source control, select Keep Checked Out.
  6. Click Check In.

How to Add Files to Source Control Using the Explorer

  1. Select View > Source Control Explorer. The Source Control Explorer opens.
  2. From the drop-down or the Home pane, select Pending Changes.

    The Pending Changes pane opens. Files that will be checked in are listed under Included Changes, and files that will not be checked in are listed under Excluded Changes. You can identify newly added files because they say [add] next to the file name.

  3. (Optional) In the Comment field, enter an optional comment tied to the check-in. This enables you to keep an audit trail for a file. The comment can then be viewed from the History dialog, which can be accessed from the Source Control Explorer, the Source Control ribbon, the File menu, or the Source Control button .
  4. (Optional) If you want to select the files or folders that you include in the check-in, right-click a file or folder and select one of the following options from the context menu.
    • Exclude Excludes the selected file from the check-in

    • Exclude Unselected Excludes all unselected files from the check-in

    • Include Includes the selected file in the check-in

    • Include Unselected Includes all unselected files in the check-in

  5. Click Check In Included to check in all of the files in the Included Changes list. The Messages pane opens and displays a list of files that were checked in.

    Note Adding files from other areas of the Flare interface (e.g., Pending Changes window pane, Source Control ribbon) will only add new files. However, if you use the Source Control Explorer to check in your files, it will check in all of your pending changes: both new files and modified files. If you do not want to include all of your files in the check in, you can right-click them and select Exclude. Files you exclude will not be checked in.