This way not only git, but many other applications will use VS Code as an editor. ![]() You can set it for current session using: export EDITOR="code -wait" Git also uses one of them (depending on Git version) if no core.editor is set. These environment variables are used by many applications and utilities to know what editor to use. git difftool ^ allows you to use VS Code as diff editor for changesĪnother useful option is to set EDITOR and VISUAL environment variables.git add -p followed by e for interactive add.git commit allows you to use VS Code for the commit message.git rebase HEAD~3 -i allows you to interactively rebase using VS Code.To summarize, here are some examples of where you can use Git with VS This leverages the new -diff option you can pass to VS Code to Now you can run git config -global -e and use VS Code as editor for configuring Git.Īdd the following to enable support for using VS Code as diff tool: From the command line, run git config -global core.editor "code -wait" Linux: Make sure you installed Code via our new. ( shift + ctrl + P in Windows)* - Windows: Make sure you selected **Add to PATH** during the *Command Palette is what pops up when you press shift + ⌘ + P while inside VSĬode. Mac: Select Shell Command: Install 'Code' command in path from the Command. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |