Reputation: 5434
How can I configure a file in a repository so that only I can change it?
I tried with getting a lock, but the file is automatically unlocked when I commit the file. I want to retain ownership of that particular file.
Reason for this is I have a configuration file that I don't want others to accidentally commit to the repository, because it will be modifiable only on the local copy.
Upvotes: 0
Views: 66
Reputation: 28174
The official FAQ method for this is to store a template of the file in the repository, then have users make a local copy of that file for their usage.
Upvotes: 1
Reputation: 8905
It is possible to keep a lock on commit, using the --no-unlock option to the commit command. For TortoiseSVN, there is a "keep locks" checkbox in the commit dialog.
It is also possible to set up a "pre-commit" server-side hook that would disallow a commit to that one file if the username is not you.
Another possible solution is to set up the lock with a URL instead of a working copy. Thus no working copy actually owns the lock. But then you'll need to deal with stealing or breaking the lock yourself when you actually do want to make changes.
Upvotes: 1
Reputation: 11
You could have the file not exist in the repository, and have a script to create a default local version of the file if none exists. You could call this script from a makefile somewhere to make it automatic. That way local changes wouldn't be any conflict.
Upvotes: 1