I\'m in a situation where I want to open source my project, however there\'s a single source file that I want to release a \"clean\" version of, but use a separate version l
Greg's approach very adequately and precisely answers your question.
Let me make an addition that takes into account what I infer to be your high-level objectives:
The simplest (and in my experience, best attested) way to accomplish this is to use the following structure:
./application.code
./config.code
./config.local.code.sample
./.gitignore
application.code
include('./config.code')
if is_file('./config.local.code')
include('./config.local.code')
end
config.code
username = 'root'
password = 'password'
config.local.code.sample
username = 'replace with your local username and rename file to config.local.code'
password = 'replace with your local password and rename file to config.local.code'
.gitignore
config.local.code
./config.local.code # will not be picked up by git due to .gitignore
config.local.code
username = 'Suan'
password = 'myownpass'
As you can see, you avoid releasing config.local.code, which actually contains your sensitive information, into the wild. The default configuration (cloned straight from a remote) will work for a reasonable, if rare, case where username root and a password password is valid. And the aptly named config.local.code.sample provides local customization instructions.