SirDerpy
SirDerpy

Reputation: 103

.gitignore not appearing in VScode's file explorer

In the standard Windows Explorer, the repo contains all the expected files: A snip of my file directory.

In VSCode, the .gitignore file does not display in the explorer. It's still seemingly functional (all files in the .gitignore are ignored), but it poses an annoyance. Most notably, the .gitignore file does appear in other repos that I have on my machine.

Help would be appreciated.

Upvotes: 10

Views: 6551

Answers (2)

Magnus
Magnus

Reputation: 11396

There are a bunch of settings related to this, VS Code is pretty flexible and powerful here.

  1. open command palette (shift-cmd-p on mac, or just type > in the regular file explorer)
  2. search Preferences: Open Workspace Settings
  3. search gitignore
  4. uncheck Use Ignore Files

There are lots of other interesting settings to fiddle with there too. Your changes will then be reflected in [your project folder]/.vscode/settings.json

Upvotes: 3

wett1988
wett1988

Reputation: 71

Check in your project folder .vscode/settings.json.

In section files.exclude most likely you will see the line

"**/.gitignore":true

Comment out or delete it and the file will appear in Visual Code Explorer

Upvotes: 7

Related Questions