0

Here's my complete .gitignore file for my Django project:

# Django Python Stack
*.py[cod]
*$py.class

# Django
*.log
*.pot
*.pyc
__pycache__/
local_settings.py
db.sqlite3
db.sqlite3-journal
media/
static/

# Environments
.env
venv/

# Visual Studio Code
.vscode/
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
.history/
.history
.ionide
*.code-workspace

and here are the staged changes:

enter image description here

So the launch.json file I've explicitly excluded is still ignored:

enter image description here

What's the solution?

Omid Shojaee
  • 333
  • 1
  • 4
  • 20
  • 2
    It is not possible to re-include a file if a parent directory of that file is excluded. See [this post](https://stackoverflow.com/a/65777181/1256234). – Andy J Apr 13 '22 at 11:32
  • 2
    I think you need to add `.vscode/*` instead of the whole directory if you want to un-ignore specific files inside of it. Otherwise it would not even look inside of the directory. – Joachim Sauer Apr 13 '22 at 11:33

0 Answers0