Answer the question
In order to leave comments, you need to log in
Ignoring files already under version control?
Let's say we have a database_config.php with all the comments and a description of all the lines, which is already under version control. (For example, we just imported an empty, unconfigured framework into the repository and containing a “raw” database_config.php)
How can I make this file check out to the developer once, but then it will not be updated (ignored) when fresh data is received from the repository ?
svn:ignore only works for files that have not yet been added to the repos. How to be?
Answer the question
In order to leave comments, you need to log in
usually the config files are in a separate folder, and we won't snap them, but only the folder with the code.
If I understand correctly, only centralized work with branches will help you. In our project, no one works with the trunk; in the trunk, such files have a standard configuration. And already each developer, working on his branch, changes these config files for himself. As far as I know, in svn you can’t do it the way you want, except to write your own tricky hooks on the server, which will, if anything, revert such files on the trunk or something like that. But IMHO it's kind of weird.
1) Database_config.example.php is created in which the actual settings are located
2) It is added to the repository
3) For the directory in which it lies, add svn:ignore = database_config.php
4) After the chuckout, we create a copy of database_config.example.php with the name database_config. php and specify individual settings in it.
The only inconvenience is that you have to update your database_config.php from time to time when adding settings to database_config.example.php
An option similar to the previous one, but not the same - use something like inheritance or cascading: there is database_config.common.php, where typical settings are described and which is versioned (a new feature has appeared in the project, the default settings are committed there and spread to all developers) and the ignored VCS database_config.instance.php which overrides only the necessary settings. Roughly speaking, the first one contains host, port, user, password, database, prefix, and the second one overrides only user, password and database or only host.
svn:ignore will work on a file that has already been added to the turnip
have you tried locking? The turtle has a description of this action ( RU , EN )
… If you lock a file, only you can commit that file. Commits by other users will be blocked until you release the block. A locked file cannot be modified in storage in any way, which means it cannot be deleted or renamed by anyone other than the owner of the lock...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question