31Releasing a Lock

After locking a file, you might change your mind and decide not to modify it. Subversion releases all the locks in a working copy when you commit a change, but if you’re not going to check in for a while, it would probably be polite to release the lock straightaway so someone else can lock the file if they need to do so.

Subversion will happily let you release a lock even if you have modified the locked file. If you later check in changes to the unlocked file, you have essentially avoided Subversion’s locking mechanism. This is bad news. Someone else could edit the file in the meantime, and your commit could force them to redo their work. You should always revert changes to a file when you release a lock.

  • Unlock a file. ...

Get Pragmatic Guide to Subversion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.