I have a .gitignore file in my repository top level folder with the following code:
# Compiled python modules.
*.pyc
# Backup gedit files.
/*~
# Setuptools distribution folder.
/dist/
# Python egg metadata, regenerated from source files by setuptools.
/*.egg-info
/*.egg
When I try to run a git add .
command the .gitignore does not make any effect, as several /*~ are added. The output for git status
is the following:
new file: uvispace/tests/test_messenger.py
new file: uvispace/tests/test_messenger.py~
new file: uvispace/tests/test_robot.py~
new file: uvispace/uvirobot/__main__.py~
new file: uvispace/uvirobot/messenger.py~
new file: uvispace/uvirobot/move_base.py
Similar Questions
I have seen several very similar questions, like this one, or this one. They solution is to remove previously added files and then add again the whole repository with the following instructions:
git rm -rf --cached .
git add *
However, I tried it and there is no difference. Anyone has an idea why is this happening?