Developer
Developer

Reputation: 8636

Is it possible to lock a file in svn so that no one can work on that expect the one who locked

As i get vexed with of lot of issues using SVN is it possible to make a file locked so that the file should not be accessed by others expect for the one who locked out. Is there such functionality in SVN.

Upvotes: 0

Views: 93

Answers (2)

Sander Rijken
Sander Rijken

Reputation: 21615

Yes, and it's conveniently called svn lock:

svn help lock
lock: Lock working copy paths or URLs in the repository, so that
no other user can commit changes to them.
usage: lock TARGET...

Also see svnbook

Upvotes: 0

Tom Anderson
Tom Anderson

Reputation: 47183

Yes - there's svn lock. A locked file can be checked out by other users, but only the lock owner can check in changes to it.

However, it's rarely a good idea to use locking. It might be a bit more convenient for the lock owner, but it slows down anyone else who needs to work on the file. The usual workflow of merging conflicts when they occur (what's called 'optimistic locking' in other contexts) is usually faster and smoother overall, and more so for larger teams.

Upvotes: 1

Related Questions