.gitignore does not work - file is still being tracked

Viewed 97171

I've a .gitignore file at the root of my repo. The .gitignore file has the following pattern to exclude the compiled Python files and that is the only line in the file.

*.pyc

Now when i do the following at the root of the repo.

git init
git add . 
git status 

It shows that it still tracks the .pyc file and tries to add it as new file. See output below.

System info: Windows 7, cygwin

Note: This issue is CLEARLY not about the ignored file being already tracked. I also tried both DOS- and Unix-style line endings on the .gitignore file.

git status gives:

# 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
#   new file:   feedapp/appconfig.pyc

How do I troubleshoot this further?

5 Answers
Related