- 複数人で開発しているときに.gitignoreに入れるほどではないけど、自分のローカルで生成されてしまったファイルやディレクトリをgitの管理対象から恒常的に除外したくなるケースがある。
 - 例えば自分だけVSCodeを使っていて、.gitignoreには追記するほどではないけど、自分の環境でのみ 
.vscodeディレクトリをgit の管理から除外したい場合。 - プロジェクトのディレクトリで下記コマンドを実行する。
 
やっていることは、ローカルの .git ディレクトリにあるファイルに除外したいファイルやディレクトリを追記するということをしている。
$ ls                                                                                                                                                              
Dockerfile          README.md           bin                 db                  log                 public              tmp
Gemfile             Rakefile            config              docker-compose.yaml node_modules        spec                vendor
Gemfile.lock        app                 config.ru           lib                 package.json        test
$ echo .vscode/* >> .git/info/exclude
$ cat .git/info/exclude
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
.vscode/settings.json
.gitignoreに追加する場合(本件とは関係ないおまけ)
.gitignore
.gitignoreファイルに下記を追記
.vscode/*
参考:
gitで常に.vscodeを無視する
Git | excludeファイルにローカル環境だけ無視したいファイルを登録