0
votes

So it happened a couple of times when I would be working on connected projects that this scenario took place:

  1. I would make a minor change to one of the config files or comment out something in a file am not tracking to test stuff.
  2. Forget to revert the changes.
  3. Come back after a while to test things that work with the initial version of the file.
  4. Waste lots of time debugging to find out step 2 was the problem.

Now I was wondering, is it possible to track some files but automatically ignore them when committing ? Think of it as a more lenient version of the .gitignore where I can choose some files to track while am developing locally, but they would never be committed. I was thinking I could make a script that unstages those specific files in the then runs the commit. However, is there something I should be paying attention to ? Or perhaps there's already a way my quick search didn't pick up?

1
If you're downvoting, could you at least explain what am I missing or misunderstanding: I would appreciate if it's more informative and I could actually learn something from it. - minasrc

1 Answers

0
votes

Keep a template for a configuration file in source control. When it comes time to actually configure a service, edit a copy of the template to provide a valid configuration. The actual configuration file never gets tracked.