1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VSCodeのエクスプローラーに`.git`ディレクトリを表示したいのです…。

Posted at

はじめに

ふと、そういえばVSCodeのエクスプローラーに.gitディレクトリが表示されていないな…。
個人的に表示されていてほしいな…。
と思ったので、その設定方法です。

環境

  • Windows11
  • WSL2
  • VSCode

設定

手で設定

VSCodeの設定画面を開く。
上部の検索条件の項目にfiles.excludeを入力する。
**/.gitを削除する。

で表示されると思います。

devcontainer.jsonで設定

調べた時に触っていたのがdevcontainer環境だったので、devcontainer.jsonに記述する場合です。

devcontainer.json
	"customizations": {
		"vscode": {
			"settings": {
+				"files.exclude": {
+					"**/.git": false, // falseにしたらOK
+					"**/.svn": true,
+					"**/.hg": true,
+					"**/CVS": true,
+					"**/.DS_Store": true,
+					"**/Thumbs.db": true
+				}
			}
		}
	},

settings.jsonでも同様の設定できそうですかね?

おわりに

.gitを表示するなんて!
と言われるかもしれませんが、個人的には隠れている方がなんとなく気持ち悪いので表示したい…という記事でした。

参考

ありがとうございました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?