man gitignore
:
A gitignore file specifies intentionally **untracked files** that git should ignore. Note that all the gitignore files really concern only files that are not already tracked by git
git rm file
will stop tracking them. I can't find a way to remove all ignored files from the repo.
As you point out, the files don't appear to already exist in the repo. In that case, your git
's behaviour matches neither the documentation or the behaviour of mine, and I can't help you.
$ mkdir foo
$ cd foo
/home/ikegami/foo
$ mkdir feedapp
$ touch feedapp/__init__.py
$ touch feedapp/appconfig.py
$ touch feedapp/appconfig.pyc
$ echo '*.pyc' > .gitignore
$ git init
Initialized empty Git repository in /home/ikegami/foo/.git/
$ git add .
$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: .gitignore
# new file: feedapp/__init__.py
# new file: feedapp/appconfig.py
#
$
Perhaps you did
git init
git add .
echo '*.pmc' >> .gitignore
git init
git add .
in which case you can fix the problem using
git rm --cached -r .
git add .