0

I have set up dev, staging, and live versions of a website which access different databases. All 3 sites are identical except for the config file. (and the changes I am working on)

The config file is where I specify which database I am accessing (test, staging, live) and I need this file in the repo because the site won't work without it.

But now every time I git pull it changes my database. If I put the config file in my .gitignore I get a merge complaint because the config is different.

What do I do?

Brian
  • 14,610
  • 7
  • 35
  • 43
Phil
  • 2,176
  • 10
  • 33
  • 56
  • Stop tracking your config file. Instead, track a template config file that you use once to create a new config file for each individual site. – twalberg Aug 12 '15 at 18:41
  • Thanks, I will do that. – Phil Aug 12 '15 at 18:55
  • Uhhh I removed the config files from my gitlab and on my next pull it deleted the config files from my project. – Phil Aug 12 '15 at 19:04

1 Answers1

0
Community
  • 1
  • 1
Rajesh Kaushik
  • 1,471
  • 1
  • 11
  • 16
  • Sparse checkout would be the wrong tool. If you don't want to track that file, then don't track it. – Tali Aug 13 '15 at 15:15