So I’m testing out Heroku with a dummy app called hellodjango, and pushing everything to git.
Added my .gitignore file (tell me if I’m wrong, I created a text document called django.gitignore, and the contents are 1 line, no spaces, venv*.log*.pot*.pyclocal_settings.py.
Not sure what I’m doing wrong, but here is my directory
hellodjango/
django.gitignore
manage.py
requirements.txt
hellodjango/
__init__.py
__init__.pyc
settings.py
settings.pyc
urls.py
urls.pyc
wsgi.py
wsgi.pyc
venv/
Include/
Lib/
Scripts/
So I don’t want to stage any .pyc files or the venv folder.
In my command line, I enter
git init
Initialized empty Git repository in /Users/Chris/hellodjango/.git/
>git add .
>git status
When I enter git status, all of the files in venv and .pyc are staged. Why is .gitignore not working?
The gitignore file needs to be named only
.gitignorewithout adjangoin front of the dot.You can find more information about ignoring files and possible patterns supported in the ProGit book on the official website: ProGit Chapter 2-2.