Category Archives: SVN

How to make svn ignore file and folders on update and commit

When we work on Production and Development environment separately on subversion, many times we need to keep a file outside of the SVN versioning. Usually conf files come under this category.

A simple method of this is to navigate to the repositry and simply issue command so that svn ignore file in that folder.

 

[php]<br /> svn propset svn:ignore -F filename .<br /> [/php]

Don’t forget to include the last “.” it tells the svn client to set this property in the current folder you are working on.

For exluding multiple files of the same

Revert files to older svn version

A lot of times developers do one or other mistakes and you need to revert the files to older version. Which basically mean that you need to merge backwards with a older version of files. So let’s say if you want to go back from version 100 to 99, you’ve to


svn update
svn merge -r 100:99 .
svn commit -m "Rolling back to version 99"

Notice the . at end of svn merge command, this tells that current directory needs to be merged if you need a particular file to be merged you need to issue


svn merge -r 100:99 conf.php
svn commit -m "Rolling back conf.php to version 99"

Hope this helps someone.

Restricting folders for svn access

While working with several developers at the same time, you really need a method to make sure that each team doesn’t mess up with someone else module. Splitting directories of each user is a nice idea when your developers are not that diciplined or when you are running multiple sites of same repository.

I faced a similar problem when i wanted to restrict access to 2 of my developers from editing anything above directories i allocated. For this

Go to your conf directory this would be located inside your main configuration directory.

#cd conf

Fire up your favorite editor, mine is nano

#nano authz

And put a access control to directory

[/repo/project/folder]
usera = rw
userb = r

Say if you have multiple repositry in svn server, restrict access to a particular repositry by

[repo1:/repo/project/folder]
usera = rw
userb = r

I think this should help.