Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing web.config from subversion (ASP.NET Project)

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

like image 642
adinas Avatar asked Dec 31 '22 11:12

adinas


2 Answers

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

like image 62
Vitor Silva Avatar answered Jan 01 '23 23:01

Vitor Silva


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.

like image 42
Chetan S Avatar answered Jan 02 '23 00:01

Chetan S