Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Git ignores all files

My gitignore file looks straighforward:

env/
.idea
*.pyc
__pycache__
*.env
/environment
db.sqlite3
*.log

When I do git add . from my root project folder and then check status – I see there is no files tracked.
When I do git status --ignored, I see that all folders are ignored:

.flake8
.gitignore
.idea/
 Procfile
 env/
 requirements.txt
 runtime.txt
 src/

So it somehow ignores all the folders and files.
I tried to comment everything in gitignore – and the result is the same.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I tried to reinitialize the git by:

rm -rf .git
git init

And the result is the same.

How can I add my files, without git add --force?
I want files that are added in gitignore to be ignored, but still to commit other files.

>Solution :

As in the comments: it seems that venv or virtualenv created a global .gitignore (in /Users/admin/.gitignore) whose second line read *, ignoring all files.

It’s not clear what caused this venv entry to be created in /Users/admin in the first place, so finding out if anything depends on it remains to be done, but in the meantime, any virtual environment data in the home directory here should be moved or removed, so that the global .gitignore isn’t there any more.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading