I have recently switched to git.
In my previous and first commit since using git, I noticed it also listed the pyc files during the commit. I didn’t think anything about it and commited and pushed them.
Now I realize they keep getting updated during the development and its very annoying seeing them in the list. It just produces too much noise.
I did some research and did echo "*.pyc" >> .gitignore in the project directory.
This didn’t help though as the pyc files are still being shown. Could it be that because I have previously committed those pyc files I can no longer ignore them? (since they are tracked now and the state has changed again) If so I am damned forever or is there still hope to delete the files in the hindsight from the repository?
Thanks
Just
git rmthe.pycfiles, and make sure your.gitignoreis set to ignore them from now on. You are correct that git will not ignore the committed files because they’ve already been added. If you are keen about not deleting the off the disk, then usegit rm --cachedto delete the files. That just deletes them from the index without deleting from the disk.