0

I'm new to git and been messing around with it using some basic HTML,CSS and JS files just to see how it works while following some videos explaining the git basics.

I've been trying to commit without using an -m and it suppose to open some sort of text editor but instead it opens inside the bash where it forces me to write the commit changes.

How do I insert it after typing the changes and how can I change it to use my VS Code editor instead of using it inside the bash terminal?

Inside bash waiting for you to insert the commit changes, no keybind what so ever seems to be working to get me out of this message.

1
  • The Git editor uses Vim by default. You can check this answer for details on how to exit Vim (press the i key to insert text) and this answer for changing the editor. Commented Oct 9, 2023 at 15:23

1 Answer 1

4

If you prefer to use you Visual Studio Code editor for writing commit msg instead of Git editor, you can do this by running this command :

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

This sets VSCode as the default editor for all Git repositories on your system. And now when you run the git commit command without -m flag, it should open your commit msg in VSCode rather than in the command line.

Now You can use git command freely in VSCode.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.