Using VSCode as Git Editor

Simply use the following command to config git editor which you can configure at the global, system, or local git configuration level. The example below shows the global level configuration.

TL;DR

$ git config --global core.editor "code --wait"
$ git config --global -e // To verify

The key point is code --wait the command which is telling the VSCode to wait for the file to close

[core]
editor = code --wait

Output

❯ git config --global -e
hint: Waiting for your editor to close the file...

--

--