I created .gitignore and within it I put config/db.js
because I want to connect to my localhost db, but still when I change the file db.js in config folder git still track the changes.
Asked
Active
Viewed 97 times
0

Jamie Jordan
- 241
- 1
- 4
- 16
-
Can you please share your full `.gitignore` file? – Mureinik Jun 04 '16 at 09:31
-
@Mureinik just one line which is `config/db.js` – Jamie Jordan Jun 04 '16 at 09:35
-
5Were you already tracking it before you added it to the ignore file? – jonrsharpe Jun 04 '16 at 09:38
-
@jonrsharpe yes. am I doing it wrong? I assume if it's tracked and I add it into `.gitignore` and it will become untrack, no? – Jamie Jordan Jun 04 '16 at 09:46
-
@jonrsharpe when I git pull the config/db.js came back to my local dev. dang! what's wrong? – Jamie Jordan Jun 04 '16 at 10:17
-
*"The removal of the file from the head revision will happen on the next commit"* - you actually need to *push* the removal and ignoring. – jonrsharpe Jun 04 '16 at 10:19
-
@jonrsharpe I did. – Jamie Jordan Jun 04 '16 at 10:22
1 Answers
1
Try:
git rm --cached config/db.js

Pan Long
- 1,024
- 1
- 9
- 16
-
-
After you execute the above command, commit your change, and push to your git repository. Then the remote file should be removed. – Pan Long Jun 04 '16 at 10:24
-