SVN - ignoring files already in repository

2019-05-13 18:56发布

I have a configuration file in my project which needs to be in the repository (so new developers get it when they checkout the project). Each developer might change some values in the file locally - these changes should not be committed and I don't want them showing in the synchronization menu (I'm using eclipse and subversive if it matters).

Note that I can't just set the svn:ignore property since it only works on files that aren't under version control - but I do want to keep a base version of the file in the repository. How can I avoid the file showing in synchronization without deleting it from repository?

EDIT: A better description - what I actually need is to be able to set a "read-only" property on the config file, so it can't be changed in the repository as long as the property is on. Do you know anything like this?

Thanks

5条回答
贼婆χ
2楼-- · 2019-05-13 19:33
  • You can version template under different name

OR

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-05-13 19:35

You can't ignore files which are already under version control. The only way to ignore such files is first delete those files do a commit and after that change the svn:ignore property and do a second commit. If you like to have a kind of Base-Version use a template which has a different name.

查看更多
冷血范
4楼-- · 2019-05-13 19:36

My solution is that a compile time script creates a copy from the original template file if it does not exist. This copy can be put on the ignore list. I feel that locking a file for this purpose abuses the locking feature (it was not created for this).

查看更多
地球回转人心会变
5楼-- · 2019-05-13 19:41

I do this by having a base version of the file checked-in as foo.base, and svn lock this so that it's read-only on checkout. Then have each developer copy this file to their own personal foo file, which is ignored by svn-ignore.

查看更多
看我几分像从前
6楼-- · 2019-05-13 19:42

once u check out, u can lock it, and once it is locked, others will not be able to commit(make changes to svn) that file. see image below enter image description here

查看更多
登录 后发表回答