I tried some solutions provided here, but my solution was to write
.vscode/
on the .gitignore.
By default, Angular writes the next lines for vscode files on its gitignore:
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*