'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 1:[1]

I had the same issue for a few days and I finally found a solution, on Win10 it's Ctrl + c, then you quit editing mode. You can then type :x! to save commit message and quit Vim.

Solution 2:[2]

Other answers already explained how you can do it within the UI. But you can avoid opening vim by passing the commit message as an argument to git commit command within intellij built in terminal.

git commit -m "Some commit message"

Solution 3:[3]

Intellij navbar

You should click on the magnifying glass and type commit.

Then the commit box opens. Type your message and commit. Commit box on intellij

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 one-hand-octopus
Solution 2 deepakchethan
Solution 3 Alex Spitz