Use Cmd + Shift + P
to open the command menu
Type and select: Shell Command: Install 'code' command in PATH
This allows you to open VS Code from your terminal.
ex: In your terminal, type code .
from your terminal to open the current directory in VSCode.
2. Change your .gitconfig
file in your home folder (use Cmd + Shift + .
in Finder to see hidden dotfiles) to use the above VSCode command (instead of vim) for typing commit messages etc:
Open ~/.gitconfig
in your editor and add the following. You may or may not already have any config options here - you don't need to erase any existing ones, just make sure that at minimum the following fields are present:
(the --wait
flag means that the commit or other git process will be completed once you save & close the editor tab, instead of leaving the process hanging).
[user]
name = Santa Claus
email = [email protected]
[commit]
[core]
editor = code --wait
[diff]
tool = default-difftool
[difftool "default-difftool"]
cmd = code --wait --diff $LOCAL $REMOTE
[merge]
tool = code --wait
Notice under the [user]
config above, the email is set to [GITHUB_NAME]@users.noreply.github.com
.
This is a handy feature offered by Github.
Git forces you to set an email, but then of course this email is visible to anyone on the Internet for all of your public repository commits.