0

I think I'm using .gitignore wrongly. I try to retain my config/db.js to have 2 version, one is to connect to localhost db on my developement environment, one is to connect to live db.

I created .gitignore file and put in config/db, so that I can achieve that. I commit and push everything is working ; but when I put, someone config/db.js got overwritten. What's wrong?

Timofey Stolbov
  • 4,501
  • 3
  • 40
  • 45
Jamie Jordan
  • 241
  • 1
  • 4
  • 16
  • http://stackoverflow.com/questions/1274057/making-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore – jbe Jun 04 '16 at 10:26

1 Answers1

1

you have to remove config/db.js from git and then ignore it

$ git rm --cached config/db.js
$ echo "config/db.js" >> .gitignore
jbe
  • 1,722
  • 1
  • 12
  • 20