When you are working, you may want to lock the files you have modified. Locking a file does not prevent other users from modifying the file. However, no one else can commit a file that you have locked unless they steal the lock from you or until you remove the lock.
You can steal a lock from another user if you need to commit the locked file while they are working on it. Likewise, another user can steal a lock on a file you have locked.
In the Source Control Explorer or File List, select the relevant file(s).
Open a file.
- Do one of the following, depending on the part of the user interface you are using:
Ribbon Select the Source Control ribbon. In the File section select Lock.
- Right-Click In the File List, right-click the files you want to lock and select Source Control > Lock.
- Local Toolbar In the File List, select the file(s) you want to lock. In the local toolbar of the File List, click , then select Lock.
- Source Control Explorer Right-click the files you want to lock and select Lock.
The Lock dialog opens. The selected files are listed with check boxes next to them.
- (Optional) Enter an optional comment tied to the lock. 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 .
- (Optional) If you want to steal another user's lock so you can commit the file while they are working on it, select Steal the Lock. This will give you the lock so you can commit the file.
- Make sure to select the check box next to each file you want to lock so it contains a check mark.
- Click Lock.
Note: You cannot lock files with Rename status.
Note: Subversion will automatically lock a modified file when saving changes (if it is not already locked) if you selected the option to automatically check out files from source control when saving them. Because there is not a "checked out" status for Subversion files, these files will be marked as modified and can be committed.