gotchaModerate
Gitignore not working for tracked files
Viewed 0 times
cachedrm cacheduntrackindex
Error Messages
Problem
Adding a file pattern to gitignore does not stop git from tracking files already committed. The gitignore rules only apply to untracked files not files already in the git index.
Solution
Remove the file from the index without deleting it locally: git rm --cached filename. Then commit the removal. The gitignore pattern will now take effect for future changes to that file.
Revisions (0)
No revisions yet.