Checking In Source Control Files—Team Foundation Server

When you are finished editing files, you can check them in to source control. Checking in a file overwrites the old copy of the file in the database with the new one from your local machine. Even if others are not working on a file, it is a good idea to periodically check in files for a backup in source control.

How to Check In Files to Source Control

  1. Do one of the following, depending on the part of the user interface you are using:
    • Pending Changes Window Pane From the Source Control ribbon, open the Pending Changes window pane. Select the files in the window pane that you want to check in, and in the local toolbar click .
    • RibbonSelect Source Control > Check In (for selected files) or Source Control > Check In All (for all files in the project).
    • Right-Click In the File List window pane, right-click the file you want to check in and select Source Control > Check In (for selected files) or Source Control > Project > Check In All (for all files in the project).

    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, 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 keep the files checked out of source control, select Keep Checked Out. Doing this will overwrite the source control copies of the files so that they have the latest changes, but it lets you continue working on the files. This is a useful option if you are the only author working on the files in question.
  6. Click Check In.

    If no other users have also made changes to the file and checked it in while you were working on it, your version of the file is checked in.

    However, if that is not the case, the Resolve Version Conflict dialog opens to let you know that another user has already checked in the file with changes. You can merge the files automatically if there are no conflicting changes (i.e., changes do not occur in the same location in the file). If there are conflicting changes, you can use the Merge Changes dialog to determine how changes are merged. See Merging Source Control Files—Team Foundation Server.

How to Check In 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 changed files because they say [edit] 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, or the Source Control button .
  1. (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

  2. Click Check In Included to check in all of the files in the Included Changes list.

    If no other users have also made changes to the file and checked it in while you were working on it, your version of the file is checked in. The Messages pane opens and displays a list of files that were checked in.

    However, if that is not the case, the Resolve Version Conflict dialog opens to let you know that another user has already checked in the file with changes. You can merge the files automatically if there are no conflicting changes (i.e., changes do not occur in the same location in the file). If there are conflicting changes, you can use the Merge Changes dialog to determine how changes are merged. See Merging Source Control Files—Team Foundation Server.