Checking Items In and Out

See Also

When you check an item in to the source control server, the source control system changes the status of the file from read/write to read-only, and updates the copy of the file in the database to synchronize it with the local copy.

After you check an item into source control, that item is available for other people to work on. If you want to return an item to source control without any changes, you can undo the check out.

Checking out an item copies the version of the item from the source control server to your local machine and makes it read/write on the local machine. This action also locks the item on the source control server, by making it read-only (unless your source control is configured to do multiple checkouts).

It is possible to check in items through either the Microsoft development environment or your source control program. By performing all your major source control operations through the development environment, however, you ensure that the development environment updates projects and solutions correctly.

To check out a solution, project, or item from source control through the development environment

  1. In the Project Explorer, select the item that you want to check in to source control. The selection must already have been added to source control to be available to check out.

  2. On the Project menu, point to Source Control, and then click Check Out.

    If the check out command is visible but grey, this means the item is checked out by someone else. If the item is invisible, this means that checking out this item is an inappropriate action at this time.

  3. In the Check Out Items dialog box, verify that the items you want to check out are selected, and then click OK.

To check in a solution, project, or item to source control through the development environment

  1. In the Project Explorer, select the solution, project, or item that you want to check in to source control. To check in an item, you must have checked the item out from source control.

  2. On the Project menu, point to Source Control, and then click Check In.

  3. In the Check In Items dialog box, select the items you want to check in, and then click OK.

To automatically check in all items when closing the solution

  1. On the Tools menu, click Options.

  2. In the Options dialog box, expand the Environment node, and then click the Source Control node.

  3. Select the Check in everything when closing the solution check box.

  4. Click OK.

To undo a check out

  1. In the Project Explorer, select the item that was checked out.

  2. On the Project menu, point to Source Control. Click Undo Check Out.

  3. In the Undo Check Out dialog box, select the items you wish to return to their previous state.

  4. Click OK.

    Undoing the checkout erases any changes you made to that item and returns it to the state it was in before it was checked out.