how to get out of git bash editor

C++
On Windows GIT Bash Ctrl + X would do nothing and found out it works quite like 
vi/vim. Press i to enter inline insert mode. Type the description at the very 
top, press esc to exit insert mode, then type :x! (now the cursor is at the 
bottom) and hit enter to save and exit.
Source

Also in C++: