Yacoby
Yacoby

Reputation: 55445

SVN Private File

I have a web-based application that I would like to open source by using a public svn host, the problem is that the project contains configuration files which I would rather keep some of the values private. What is the best way of handling this?

Ideally I would like to be able to import revisions without having to replace the file with a file stripped of private data every time.

Upvotes: 2

Views: 587

Answers (2)

Pekka
Pekka

Reputation: 449385

Maintain two configuration files:

  • One named, say, config.php
  • Another named config.dist.php

config.php is your live settings file where you store your runtime configuration with private data, paths and such.

config.dist.php is the same file but with default or dummy configuration settings.

Whenever your project gets a new configuration setting, you test it in your live config.php file and afterwards copy it into the .dist file, giving it a dummy value.

Set your version control to ignore config.php.

That way, you will never have private data in your repository, but somebody checking out the project has a default configuration file to start right away.

Upvotes: 6

anon
anon

Reputation:

User specific configuration files should not be part of the source of a FOSS project. If you want to version control them, keep them in a separate, private repository.

Upvotes: 4

Related Questions