I have a TeX project. I want to ignore some file extensions which I have added in the .gitignore file, but they are still shown as untracked files in git status. How to make git not track these files? A figure is added showing the VS code workspace along with the staged area git ls-files and output of git status. You can see the message about the same files being untracked in color red.
.gitignore not ignoring files correctly
85 Views Asked by rupsagar At
2

Fixed it. It works if I create the
.gitignoreusing Windows Subsystem for Linux (Ubuntu). It does not work if created through Windows 10 VS Code editor. A similar thing is also mentioned in this solution. It also worked when I created the.gitignorefile using echo in Git Bash which is a Linux environment. Strange indeed! It probably has something to do with the carriage return (CR) and line feed (LF).