Prevent Commit and ignore local changes with tortoise svn

Viewed 346

Is there a way in Tortoise SVN to add a file to the svn and freeze the version of it and ignore local changes to that file.

  1. I have a little unittest-project every developer uses. They have to make little adjustments to an ini.file in order to get the tests run on their PC. But those changes aren't allowed to be comitted to the svn. How can I prevent the commit of this file.

  2. If the unittest project is added as external svn in another repository. Windows will show, that there are local modifications, if the developer adjusts the ini-file to his needs. Can I somehow ignore the ini-file for the check for local modifications? I only know about the ignore-feature, but this requires to remove the ini-file entirely out of the repository and I don't want to do that.

2 Answers

You can use the ignore-on-commit changelist:

ignore-on-commit

However this feature is only intended to prevent accidental commits. To really enforce it you need a server-side solution, such as creating a repository hook that rejects commits that include that file.

The best solution though would be to not have that file in the repository to begin with. Instead, you commit a template (the file you already have with a different name like settings.ini-template, settings.ini-production...) and then add the name of the actual file that the tool uses to the svn:ignore property, which in TortoiseSVN can be accomplished with the Unversion and add to ignore list menu item.

Unversion and add to ignore list

I have a little unittest-project every developer uses. They have to make little adjustments to an ini.file in order to get the tests run on their PC. But those changes aren't allowed to be comitted to the svn. How can I prevent the commit of this file.

Configure Read Only permissions on the server side to these files. See SVNBook | Path-based authorization, and - if you use VisualSVN Server - KB33: Understanding VisualSVN Server Authorization.

Related