For now this page will serve only one purpose: To explain how to set up autoprops
in your Subversion configuration (as opposed to being a complete guide to the world of committing).
Files in Subversion have metadata which describe what type of data they hold -- text, binary, executable (so that the file is marked as executable in a Unix environment), and so on. These are hints to Subversion:
When add
-ing or import
-ing new files to the repository, autoprops
automates the process of setting metadata. A regular expression maps a file name to a group of properties to set (*.exe
should be binary, for instance).
For files not covered by the patterns below, or if you do not want to use autoprops
, you can set metadata with svn propset
, svn propget
, and svn proplist
, e.g.:
svn propset svn:mime-type text/plain foo.txt
If you're a rebel and want to roll your own config file, or you're adding files which don't match one of the existing patterns (*.newkindofbinary
or executable-binary-without-extension
), it's important that you set metadata according to these guidelines (eventually a script will catch outlaws, for now you're on the Honor System).
Rule: All files must have metadata.
text | svn:mime-type=text/plain; svn:eol-style=native |
binaries | svn:mime-type=application/octet-stream |
executable scripts | svn:mime-type=text/plain; svn:eol-style=native; svn:executable |
The Subversion configuration file is located at C:\Documents and Settings\<user>\Application Data\Subversion\config
. You can download a pre-configured config
and overwrite the existing file; if you'd like to amend an existing config file, integrate the settings in the next section.
TortoiseSVN sometimes uses a different configuration file. To access the TortoiseSVN configuration file:
Tortoise's config
file will open in Notepad, it may be the same one you edited. If not, repeat the changes.
The Subversion configuration file is located at ~/.subversion/config
. You can download* a pre-configured config
and overwrite the existing file; if you'd like to amend an existing config file, integrate the settings in the next section.
config
is just a text file without an extension. You can open it in Text Edit.These are the minimum required mappings. If any important file types are missing, please suggest them in the comments.
[miscellany]
enable-auto-props = yes
[auto-props]
# IMAGES
*.gif = svn:mime-type=image/gif
*.jpg = svn:mime-type=image/jpeg
*.png = svn:mime-type=image/png
# BINARIES
*.abc = svn:mime-type=application/octet-stream
*.err = svn:mime-type=application/octet-stream
*.exe = svn:mime-type=application/octet-stream
*.jar = svn:mime-type=application/octet-stream
*.pdf = svn:mime-type=application/pdf
*.swc = svn:mime-type=application/octet-stream
*.zip = svn:mime-type=application/octet-stream
# TEXT
*.as = svn:mime-type=text/plain;svn:eol-style=native
*.css = svn:mime-type=text/plain;svn:eol-style=native
*.dtd = svn:mime-type=text/plain;svn:eol-style=native
*.htm = svn:mime-type=text/plain;svn:eol-style=native
*.html = svn:mime-type=text/plain;svn:eol-style=native
*.java = svn:mime-type=text/plain;svn:eol-style=native
*.jj = svn:mime-type=text/plain;svn:eol-style=native
*.js = svn:mime-type=text/plain;svn:eol-style=native
*.jjt = svn:mime-type=text/plain;svn:eol-style=native
*.mxml = svn:mime-type=text/plain;svn:eol-style=native
*.properties = svn:mime-type=text/plain;svn:eol-style=native
*.project = svn:mime-type=text/plain;svn:eol-style=native
*.svg = svn:mime-type=text/plain;svn:eol-style=native
*.txt = svn:mime-type=text/plain;svn:eol-style=native
*.vm = svn:mime-type=text/plain;svn:eol-style=native
*.xml = svn:mime-type=text/plain;svn:eol-style=native
*.xsl = svn:mime-type=text/plain;svn:eol-style=native
*.vsl = svn:mime-type=text/plain;svn:eol-style=native
# EXECUTABLE
*.py = svn:mime-type=text/plain;svn:eol-style=native;svn:executable
*.bat = svn:mime-type=text/plain;svn:eol-style=native;svn:executable
*.sh = svn:mime-type=text/plain;svn:eol-style=native;svn:executable