Git: Add Current File to .gitignore
git.addToGitignore Add the current file to the repository's .gitignore.
How to run it
Open the command palette (M-x in the Emacs keymap) and search for Git: Add Current File to .gitignore, then press Enter. It has no default keybinding, but you can bind one in Settings → Keymaps.