Search code examples
gitintellij-ideagit-commit

How do I commit a git message in IntelliJ's terminal?


When committing my changes to git using the IntelliJ terminal and a message is prompted, how do I then save that message and complete the commit?

Since it's using vim the usual approach is to hit esc and then type :wq to save and quit. However hitting esc just retargets the window I was viewing before (in this case the code file).

Is there a different way to save these files when using the built in terminal?

Thanks.


Solution

  • The default key binding in IntelliJ IDEA for switching focus from the integrated terminal to the editor is ESC. You can change this binding in the following way:

    1. Open settings (Windows) or preferences (MacOS)
    2. Navigate to Tools > Terminal
    3. Click on Configure terminal keybindings behind the checkbox Override IDE shortcuts
    4. Change or remove the key binding for Plugins > Terminal > Switch Focus To Editor