0

I am new to Git Bash. When I installed Git Bash on my windows system, It asked for the default editor. I didn't know about at first, so I selected the default Vim editor. Actually I am using Visual Studio Code for HTML/CSS/JS in web development.

Can I change to Visual Studio Code editor for now? Will it cause any problem in future works while using Git Bash? I still not found any answer for this question. But I think, I will get my answer now. Thank you in advance.

Leediyal
  • 3
  • 3

2 Answers2

0

Default editor in Git Bash has nothing to do with the editor you use for programming. You can edit your code as you like in the editor of your choice.

The default editor in Git Bash means that if you run a command such as

git commit --amend

to amend your last commit, then git will open the commit text in vim.

KarateKid
  • 2,036
  • 3
  • 15
  • 35
0

Yes changing the code editor is fine and is not supposed to cause any issues.

If you want to change the code editor, you can use the following command:
git config --global core.editor [editor-path]

For example, to use Atom:

git config --global core.editor "atom --wait"

To use Sublime:
git config --global core.editor "'c:/program files/sublime text 3/subl.exe' -w"

More information here

Also, here is a link on how to set VS Code as the default editor

David
  • 550
  • 1
  • 5
  • 14
  • Hello David, Do you know the editor-path for VS Code editor? That's not in the link above. – Leediyal Jul 17 '18 at 12:09
  • Its easy, use git config --global core.editor "[code] --wait" .Replace the [code] with the path for VS Code EXE. Here is a usefuly link: https://stackoverflow.com/questions/30024353/how-to-use-visual-studio-code-as-default-editor-for-git – David Jul 17 '18 at 12:24