How do I avoid checking in local changes to the SVN repository?

后端 未结 8 992
有刺的猬
有刺的猬 2021-01-05 08:19

I have to make local changes to my project files in order to get it to run in a different environment. Twice now I accidentally checked those changes in (and messed up ever

8条回答
  •  生来不讨喜
    2021-01-05 08:54

    I generally try to arrange things so the standard files SVN checks out can be overridden by a separate file which is svn:ignore-ed

    For example, I have a bash script which starts a Jetty web server using a config file. Normally it is jetty.xml, but if jetty-local.xml is present on the filesystem, that's used instead.

    (Of course, the obvious problem there is that when jetty.xml gets some updates, they won't be merged into jetty-local.xml, but that may be less of a problem than what you're already facing.)

    In a PHP project I used to work on, this was taken even further with two separate code trees - /system where all the system classes were checked out, and /local which mirrored it, but was empty unless a local class were added, in which case it was loaded in preference. That may well be getting too fancy for its own good.

    If it's configuration files which you own that are the problem, another solution I've used is to arrange to read them hierarchically (i.e. read in global.cfg.default, then overwrite with any settings in global.cfg.local).

提交回复
热议问题