Why is Codium not ignoring UNTRACKED files that are listed in .gitignore?

164 views Asked by At

I am using Codium, the de-Microsofted version of VSCode and am editing a node JS repo that I don't own on Github.

After downloading the repo and opening it in the editor, I added a .env file and ran npm install. The included .gitignore file already includes entries for .env and the folder 'node_modules', so as far as I am aware, the editor should not be tracking these files. However these files are being tracked. The system asks me if I'd like to add 'node_modules' to the .gitignore file, but it's already in there.

I've read several threads on this topic, but they all address situations where the problematic files have previously been added to the git repository - with commenters pointing out that .gitignore won't ignore them because they are already being tracked and that the solution is to clear the cache, re-add the relevant files and then commit to Git. This isn't my problem though (unless I am missing something).

In my case, the files were never committed to the repo and clearing the cache or even deleting them doesn't fix anything. I am not able to push to the remote repo as part of a solution here.

As far as I am aware, if I download a fresh repo, add some files to it and those files are already mentioned in the .gitignore file, then VSCode (Codium) shouldn't ever be tracking them - so why is it?

I have read through 20+ threads on StackOverflow now that are similar to this but none of them provide a working solution. Here are some notes in response to the common threads that have occurred in the related posts:

Note: I am editing in Fedora/Linux, not Windows and can see .gitignore file is UTF8 - so I don't think this is caused by the character encoding issue highlighted in other posts.

Note 2: The .gitignore file contains the following in this format: node_modules .env

Both the node_modules folder and .env file are being tracked even though they are not meant to be.

Note 3: If I run git status, the files in question are not listed in the output (there are no files listed in the output).

Note 4: The files in question are not in the remote repo.

Thanks

UPDATE: I could not wait to resolve this as I needed to work on the code. In the end I was considering switching editors, but I decided to completely delete the repo from my machine and start again (since I hadn't yet made any significant changes to the code. At first this seemed to solve the problem, but once I logged out of Fedora and back in again, Codium started to spuriously detect the files which are meant to be ignored as files to track. So I have not yet solved this problem.

As requested, here is the about text from Codium:

Version: 1.84.0 Release: 23306 Commit: 695a9146b1347633e608f9f166c81b5b2843b492 Date: 2023-11-02T15:23:23.641Z Electron: 25.9.2 ElectronBuildId: undefined Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Linux x64 6.5.11-300.fc39.x86_64

Screenshot update:

codium node_module message

0

There are 0 answers