IdeoREX
IdeoREX

Reputation: 1485

Closing a Terminal File

I'm working on Git Immersion lab 8. enter link description here

I ran "git commit" and it opened the editor. I understand how to write on the editor, but once I am done what do I do? How do I save and close this editor while maintaining my terminal work?

Thanks! my current terminal

Upvotes: 1

Views: 14836

Answers (1)

cedmans
cedmans

Reputation: 302

You appear to be in vim and are in insert mode.

To save and close, you have to get out of insert mode. Hit the 'escape' key (or control-[, which I personally like since I don't have to pull my fingers away from the keyboard. I'm not currently at a mac, so I'm not sure if it's control-[ or command-[ in your terminal).

Now type ':wq', without the quotes. Don't forget the colon. This is a vim command which will (w)rite and (q)uit.

I believe git has opened this file for you as a temp file, and once you've finished writing to it, git will use that file automatically for your commit message. No worries about where to save it.

Upvotes: 9

Related Questions