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!

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 Working With Git Repositories

Why is my (mac) command line git asking to 'insert' upon trying to commit a git file?

Let's say I create a new git file, named README. I add this using "git add REAME" and then I commit using "git commit README"

When I try to commit on my computer, I get this weird prompt to "insert" and I am not sure how to move forward because I don't have an insert on my computer, plus it is not really a prompt, it is just there. Here is a screenshot: https://imgur.com/a/1pCnZ

Would love some help with this:)

2 Answers

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

That's Vim (or Vi). If you type something, do letters appear? If so, great!

  1. Type your commit message
  2. Press esc
  3. And then :wq, which will *w*rite the file (save it) and *q*uit Vi/Vim.

If you can't type anything, press the i key go into insert mode and then start at #1 above.

And, like Alexander Nikiforov said, you can change the default editor on your system if you want.

You can also avoid all of this by using the -m flag when you make a commit with Git.

git commit -m "Your commit message here" will completely skip the editor part.