I want to configure my default git editor to Visual Studio Code, but I get the following error after configure it and then use it:
username ~ $ git config --global core.editor "code --wait"
username ~ $ git config --global -e
hint: Waiting for your editor to close the file... code --wait: code: command not found
error: There was a problem with the editor 'code --wait'.
I have no idea how to fix it... Do you know how I could do it?
Thanks!!
On your VSCode,
SHIFT+Command+P
Shell Command: Install 'code' command in PATH
It will set 'code' to executable PATH of vscode.
Now run below in terminal:
git config --global --edit
This happens because the code
command is not added in PATH. Follow these steps to add the code
command in PATH:
SHIFT+Command+P
.code install
and an optionShell Command: Install 'code' command in PATH`
comes up. Click on that.
code
command gets added to PATH.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With