I faced this issue the other day. I didn't put *.log
file in the .gitignore
file earlier.
The problem: I had already committed a few log files before and so it was already in the git. When I added the git ignore rule for excluding log files it wasn't removed automatically. Turns out for files already checked into git, we first need to untrack those files before we add the rules for ignoring those files.
Command for untracking the file:
git rm --cached FILENAME
Reference: https://stackoverflow.com/questions/4308610/how-to-ignore-certain-files-in-git
Top comments (0)