Reputation: 4250
If I change a bunch of files and then run command git add .
it includes all the files along with .gitignore
in my commit list.
If I use git rm --chached .gitignore
then it is showing as deleted: .gitignore
and git add .
is adding the deleted .gitignore
file
How can I IGNORE .gitignore
itself so that git add .
command adds only my changes in actual files or directories.
Upvotes: 0
Views: 1009
Reputation: 10423
First of all, why would you want to ignore the file, it is supposed to be checked in.
If you want to ignore it, you can enter it into .gitignore
itself, but it is probably better to handle local ignores differently: don't put them into the workspace .gitignore
(but .git/info/exclude
or globally define a exclude file for all repos (but outside the workspace): git config --global core.excludesfile ~/.gitignore
).
Besides that, if the file is not tracked you can remove it with git reset HEAD -- .gitignore
.
Upvotes: 5