Check Out and Edit Files
When you want to edit a file you can open it from Solution Explorer or from Source Control Explorer. When you begin editing a file, it is automatically checked out to you. In rare situations (for example, you want to check out and lock the file to make sure your changes are checked in before changes from other team members), you might need to manually check out (and optionally lock) an item.
Required permissions
You must be one of the Contributors for your team project. See Team Foundation Server Default Groups, Permissions, and Roles.
What do you want to do?
Check out an item
Work from the command prompt
Get tips
Manually check out items
To manually check out items
In Solution Explorer or in Source Control Explorer, select the files that you want to edit, open their shortcut menu, and choose Check Out for Edit.
(Optional) You can lock the file.
Important
As a best practice, use the Lock type option with discretion and notify your teammates why you are locking an item, and when you plan to remove the lock.
On the Lock type menu, choose:
Unchanged: Do not apply a lock to the items.
Check Out: Prevent other users from checking out and checking in the items until you check in and unlock them.
Note
In Visual Studio Team Foundation Server 2012 this option is not available if you are using a local workspace. Also, this lock is not enforceable because other users might be using local workspaces. See Understand Lock Types.
Check In: Allow other users to check out the items you are checking out, but prevent them from checking in their changes until you check in your changes and unlock the items.
Note
The Lock type menu is not available if:
-
Another team member has locked the file.
-
The Enable multiple check-out option has been cleared (not a recommended practice) by an Administrator of your team project. Administrator: On the menu bar, choose Team, Team Project Settings, Source Control).
If any other users have locked any of the specified items, the lock operation will fail. For more information, see Lock and Unlock Folders or Files.
Choose Check Out.
In Solution Explorer and in Source Control Explorer, a check mark appears next to the items that you have checked out. In Team Explorer, a pending edit change to the file is displayed on the Pending Changes page. In Source Control Explorer, a pending edit change is visible to you and to members of your team.
Work from the command prompt
Get Command Get files from the server.
Checkout (or Edit) Command Check out files from the server.
Tips
If you are beginning a new task, it’s probably a good idea for you to download the latest files from the server before you check out files and begin your work.
To help you and your team organize and track your work, you should use the My Work or Pending Changes page to associate a task or a bug with the work you are doing. See Develop Code and Manage Pending Changes.
If you use a server workspace, files that you have not checked out are read-only.
You can review and manage your work, suspend your work, and ultimately contribute your work to the team’s codebase.