1

We just switched to Mercurial from SVN. I have some local properties file like jdbc.properties that refers to my local database and is never checked into repository. When I try to pull files Mercurial complains there are uncommited files. How to best deal with this situation

Regards

1 Answers1

0

If you never want to commit jdbc.properties to your repository, you should ignore it.

Check out the link for more information - in short, you'll have to create a text file called .hgignore in your working directory, and input the files names of the files you want to ignore.
Then, you'll never see the files again when you try to commit, and Mercurial won't complain about uncommitted files anymore.


If the application won't work without the config file and you want some version of it in the repository, you might not want to ignore it.
Because if you do, you can't just clone the repository and start your app - it will complain about the missing config file.
Plus, you probably want to have your configuration files under source control as well - just without "secret" data like usernames and passwords.

Maybe this approach is something for you then.
The example shown there is in MS Visual Studio (because that's what I'm using), but you can something similar in any other stack.

Community
  • 1
  • 1
Christian Specht
  • 33,837
  • 14
  • 123
  • 176
  • A default version of jdbc.properties is checked into source control. Its just that each developer has his own copy that is a little different and point to his own local database. I guess ignore it could work, but have to make sure that I can get any updates on ignored files. – user3485807 Dec 09 '15 at 18:54
  • OK, this is **exactly** the use case which I described in the link in my last paragraph. – Christian Specht Dec 09 '15 at 20:33