views:

994

answers:

5

I have a project which is source controlled using Subversion and VisualSVN. Since the version of web.config is different on the server and the developers' computers I want the file to remain on the computers but to be ignored by Subversion. I added it to the svn:ignore but it still remains (and still has a red exclamation mark too since we are not committing it).

How can I remove it from Subversion safely without it being deleted from the files system

Thanks, Adin

+1  A: 
svn rm --force web.config
svn commit

Be careful to back up your local copy (of web.config) before doing this, since it will be deleted.

ionut bizau
+3  A: 

you'll have to do both the remove and ignore operation

  • first make a backup of your local file (like @ibz said)
  • then remove the web.config from the repository.
  • then copy back the web.config to the same folder
  • finally use svn:ignore so that subversion does not try to add it again to the repository

since i use tortoisesvn i can't really tell you what svn commands you have to use, but using tortoisesvn it would be:

  • make backup
  • right click on web.config on the folder under source control, select TortoiseSVN | Delete
  • right click on web.config on the folder under source control, select SVN Commit => after this you will notice that the file is actually deleted from the file system
  • move up and right click on the folder under source control, select TortoiseSVN | Properties
  • on the properties window click new + property name "svn:ignore"; property value "web.config". accept changes
  • commit changes

on my .net projects i include the following exclusion with svn:ignore: bin, obj, *.suo, *.user

vitorsilva
A: 

Hi guys,

How would I go about including things in my repository (binary files FLA's etc) but telling SVN not to track changes on these files?

Cheers

Greg B
+2  A: 

Ideally, you should maintain versions of server's copy of web.config in SVN too. We usually rename the production web.config to web.config.prod (a copy for each of the environments) and have the build tool pick the right file and rename it back to web.config while packaging for deployment.

Chetan Sastry
The way we deploy is:1. Commit to SVN on Dev pc2. On server do "svn up filename"
adinas
Are you committing compiled code?
willoller
Which build tool are you using for this modification? Are there any specific ccnet task for that kind of web.config modifications?
Gökhan Ercan
A: 

I have solved this issue using nant with ccnet. Following nant build script replaces web.test.config file with local web.config file;

<?xml version="1.0"?>
    <project name="Project1" default="build">
      <target name="init" depends="clean" />
      <target name="clean" />
      <target name="checkout"/>
      <target name="compile"/>
      <target name="deploy"/>
      <target name="test"/>
      <target name="inspect"/>
      <target name="build" depends="init, checkout">
        <call target="compile" />
        <call target="inspect" />
        <call target="test" />
        <call target="deploy" />
      </target>

      <copy file="..\TestDeployments\Project1\Project1.Solution\Project1.Web.UI\web.Test.config" 
          tofile="..\TestDeployments\Project1\Project1.Solution\Project1.Web.UI\web.config" 
          overwrite="true" 
       />
       <delete file="..\TestDeployments\Project1\Project1.Solution\Project1.Web.UI\web.Test.config" />

    </project>

NAnt Copy Task

Gökhan Ercan