Storing file permissions in Subversion repository Storing file permissions in Subversion repository windows windows

Storing file permissions in Subversion repository


SVN does have the capability of storing metadata (properties) along with a file. The properties are basically just key/value pairs, however there are some special keys like the 'svn:executable', if this property exists for a file, Subversion will set the filesystem's executable bit for that file when checking the file out. While I know this is not exactly what you are looking for it might just be enough (was for me).

There are other properties for line ending (svn:eol-style) and mime type(svn:mime-type).


There's no native way to store file permissions in SVN.

Both asvn and the patch from that blog post seem to be up (and hosted on the official SVN repository), and that's a good thing, but I don't think they will have such metadata handling in the core version any time soon.

SVN has had the ability to handle symbolic links and executables specially for a long while, but neither work properly on Win32. I wouldn't hold my breath for another such non-portable feature (though it wouldn't be too hard to implement on top of the already existing metadata system.)

I would consider writing a shell script to manually adjust file permissions, then putting it in the repository.


One possible solution would be to write a script that you check in with the rest of your code and which is run as the first step of your build process.

This script runs through your copy of the codebase and sets read permissions on certain files.

Ideally the script would read the list of files from a simple input file.This would make it easy to maintain and easy for other developers to understand which files get marked as read-only.