Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Git Basics Getting Started With Git Committing Changes

Malte Niepel
Malte Niepel
19,212 Points

I can't get out of the git commit process

When typing git commit in my Terminal to specify what changes I have made for the README. I can't get out anymore.

The options shown on the screen below aren't there on my macs terminal either. I simply can't quit it unless I kill the process. Can someone tell me what this is?

4 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

If you don't like vim, or you want to commit using the same editor as the instructor used during the lecture.

git config --global core.editor nano

This line should do it, I think nano might be a little more user-friendly than vim.

Malte Niepel
Malte Niepel
19,212 Points

Thanks! As I'm learning to use the Terminal and git at the same time I don't know what comes more handy. I feel like both works fine, but since using nano is already more familiar I like your solution more!

Árpád Tóth
Árpád Tóth
6,504 Points

I ran into the same problem using windows.

The solution I could find was:

  1. hit esc
  2. type in ":wq"
  3. hit enter

worked perfectly for me.

Source: http://stackoverflow.com/questions/9171356/how-do-i-exit-from-the-text-window-in-git

Thank you!!!

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

I guess that's nano editor's screen that was brought up.

In nano, here're some keyboard shortcuts you can use.

  • Control + x to exit.
  • Control + o to save the change.

If you try to exit out of nano with unsaved change, nano will ask you whether to save or abandon the change.


If that doesn't help, post a screenshot of your Mac terminal and we can find out what it is.

Malte Niepel
Malte Niepel
19,212 Points

That's exactly what has not been working.

I have found the solution now. I was in vim, and here is the best answer to get out: http://stackoverflow.com/questions/13507430/git-commit-in-terminal-opens-vim-but-cant-get-back-to-terminal

I still got an error when typing the "git commit" command: There was a problem with the editor 'vi'.

I have solved this by typing "git config --global core.editor $(which vim)" in the console.

Hope someone else finds this helpful!