问题
I have a framework based project that I'm using SVN to version control. I have a local working copy I use for development, a working copy on the staging machine that's checked out the latest RC tag, and the latest stable tag checked out on my production server.
When I'm promoting a tag to live, I simply "switch" the working copy on the live box.
The framework makes lots of temp files, and makes changes to its internals as I'm developing. I don't want these changes to pollute the repo, as some of them are environment specific, and will be different on the staging and production working copies.
I can't "ignore" the files & folders, as they're already version controlled, and are needed when I switch to a new tag on either of my remote boxes.
Is there a way to tell subversion to keep the originally committed version of a file/folder in the repo, but to ignore any subsequent changes?
回答1:
You should never check out stuff from SVN on a production server. That way all the SVN meta files in the ".svn" folders are accessible from outside (in case of a web application). Instead use "svn export" to have a clean copy of your source which can be deployed on the production server.
Temp files should be ignored at all. Different branches may help to version control environment specific versions of your application.
回答2:
I finally got somewhere with this - using svn:externals to fix the offending folders to an earlier revision, without all the temp files in there.
Hope this helps someone.
来源:https://stackoverflow.com/questions/3839058/ignore-all-changes-to-a-versioned-folder-in-svn-without-deleting-from-repo