How does Subversion handle file permissions and the .htaccess file?

I am using Subversion for one of my PHP projects. I have two questions / questions:

  • How are files resolved using Subversion? If I have a file that I CHMOD before 755, and I check this file in the repository, will they have the same permissions when it is checked for other working copies? If it is not copied, do I really need to change the permissions on every scan?
  • I have a .htaccess file that I do not want to check in the repository. If I update a working copy containing .htaccess (but this file is not in the repository), will the file be deleted or will the update be left alone?
+6
php svn apache
source share
5 answers
  • The only thing Subversion knows is the executable bit, which is stored as a special property, "svn: executable". If this property is defined, the file is issued with the exec bit set. For rw flags this depends on your umask. If your umask, for example, 0022, a file without the svn: executable bit will be checked with a resolution of 0644. If your umask is 0002, the resolution will be 0664. If svn: executable is set, the exec bit is set for the owner, group, and everyone else.
  • If you did not check .htaccess for svn add, svn will leave the file alone. It will not go into the repo when committed, and it will not be deleted when the svn update starts. You will see "?" before you run svn status.
+11
source share

For # 2, you can simply add .htaccess to svn: ignore the property. Here's a good approach to what it does and how it works http://blog.bogojoker.com/2008/07/command-line-svnignore-a-file/ In truth, if you check the file, it gets permission to read / write, unless it is executable, which must have svn: executable permissions and will be checked as such. The file can also be explicitly marked with svn: needs-lock, which then makes it read-only when you check

+1
source share
  • As already mentioned, SVN will not store permissions.

    The reason is trivial:

    The user who made the check will be the owner of all the files inside his working copy, so it makes no sense to give permissions, since he already has read / write permissions for all the files inside his working copy (depending on his umask).

    For e x ecutable flag set svn-property svn: executable.

  • .htaccess

    You must add .htaccess to the svn: ignore parent directories.

    However, SVN will never change or overwrite your changes without first asking . Therefore, if some of your buddys store the .accessfile in the repository, SVN will stop the update and mention that your own .htaccess file must be deleted to continue.

+1
source share

1) ... permissions will not be transferred.

2) ... the update will leave him alone if it is not under version control.

However, double check these ideas. You are welcome.

0
source share

An example of how to make an executable file:

svn propset svn:executable ON filename 
-4
source share

All Articles