SVN commit failed: Property “svn:needs-lock” needed

Error description: Can not commit binary files into SVN repository.

Error message:
A repository hook failed
svn: Commit failed (details follow):
svn: MERGE request failed on 'XYZ'
svn: Commit blocked by pre-commit hook (exit code 2) with output:
ERROR: Commit failed for the following reasons:
Property "svn:needs-lock" needed for file "xyz binary file".
Must match regex '.*'.

Look at to see how does subversion handles binary files.

When a file consists of binary data, it’s often difficult or impossible to merge two sets of changes made in parallel by different users. For this reason, Subversion 1.2 and later offers a feature known as locking, often known as “reserved checkouts” in other version control systems.

Once a file is locked by an user, another user can not commit it.

svn:needs-lock property
If the property is attached to a file (the value is irrelevant), then the file will have read-only permissions. When the user locks the file and receives a lock token, the file becomes read-write. When the lock is released—either explicitly unlocked, or released via commit—the file returns to read-only again.

Binary files must have this property, otherwise it can not be committed. the value of this property is irrelevant.

Look at it explains SVN locking model

Add the svn:needs-lock property to the file in question. The SVN property can be set using SVN client like tortoise or using SVN propset sub command from command prompt.

svn propset svn:needs-lock '*' file name

For more information on SVN properties, look at

That’s it, try to commit it.

Leave a comment

1 Comment

  1. it worked for me , another way to solve this problem is Making your file Read only and then try to commit.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: