Reputation: 5848
Sorry if it sounds like a very simple question. But I'm still beginner. I already ignored .gitignore
file itself and everything inside .idea
folder. This is my .gitignore
file:
\.gitignore
.idea/**
I'm working on a web project and trying to ignore a single file within a folder: config/db.php
but can't reach it. Appreciate any help!
Upvotes: 1
Views: 1060
Reputation: 383
You are probably already tracking the file. From the main page:
Files already tracked by Git are not affected;
So you first need to remove the file, and if you try to commit it again, you will get a warning.
Upvotes: 0
Reputation: 76887
First, it seems that you’ve already committed the files which you want to ignore. In that case, do:
git rm -rf -—cached .idea/ config/db.php
Next, correct your .gitignore
file to have the following entries:
.gitignore
.idea/
config/db.php
Now, commit the changes in your .gitignore
file:
git add .gitignore && git commit -m “Correct ignore files”
Upvotes: 2