How do I escape the git commit window from OS X terminal?
It looks like you're inside the vi editor. Typing :wq and pressing enter should do it, i.e. save the commit message and exit. 

: enters the command mode, w is for "write" (save) and q is for "quit".

You may need to hit escape before :wq to exit the insert mode (vi is a mode based editor). 

If you want to exit without saving hit escape, :q! and enter. 

git opens your default editor so you can edit the commit message. You can change the default editor, even to graphical text editors (such as Sublime Text). See here for example.