Check out and edit files
VSTS | TFS 2018 | TFS 2017 | TFS 2015 | VS 2017 | VS 2015 | VS 2013
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.
You must be one of the Contributors for your team project. See Team Foundation Server default groups, permissions, and roles.
Manually check out items
To manually check out items
(Optional) You can lock the file.
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.
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.
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
- 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.