SVN: How do I maintain my local config.blah file?

后端 未结 9 941
天涯浪人
天涯浪人 2020-12-29 13:56

On the SVN server, there is a file called config.conf. I have a local version called the same thing (in the same place). How can I make sure that my loc

9条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-29 14:12

    Thanks to everybody. I thought Eoin might be mad, but in fact it's true. You cannot ignore a file that is in version control.

    According to the Tortoise docs

    Ignoring Versioned Items

    Versioned files and folders can never be ignored - that's a feature of Subversion. If you versioned a file by mistake, read the section called “Ignore files which are already versioned” for instructions on how to “unversion” it.

    And from the SVN docs

    I have a file in my project that every developer must change, but I don't want those local mods to ever be committed. How can I make 'svn commit' ignore the file?

    The answer is: don't put that file under version control. Instead, put a template of the file under version control, something like "file.tmpl".

    Then, after the initial 'svn checkout', have your users (or your build system) do a normal OS copy of the template to the proper filename, and have users customize the copy. The file is unversioned, so it will never be committed. And if you wish, you can add the file to its parent directory's svn:ignore property, so it doesn't show up as '?' in the 'svn status' command.

    This is terribly annoying... I guess I'll just have to be careful with that file and make a backup copy of my own config (which I can ignore).

    Thanks to everybody for your answers.

提交回复
热议问题