Reputation:
Part of my .gitignore looks like below:
## Ignore logs
/log/
/log/development.log
Yet development.log
is always in modified files when commiting.
I tried to remove --cached
and remove file altogether. No luck.
Also I have recently pushed it to remote (by mistake).
Any idea how to solve that bugger once and for all?
Upvotes: 0
Views: 508
Reputation: 1165
Try
log/*
(without leading slash)
And probably
git rm --cached log/development.log
to remove the file from index. You may also check this question How to make Git "forget" about a file that was tracked but is now in .gitignore? to remove accidentally commited log file.
Upvotes: 2