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 trialDave _
1,756 PointsWhy 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
Treehouse Guest TeacherThat's Vim (or Vi). If you type something, do letters appear? If so, great!
- Type your commit message
- Press
esc
- 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.
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 PointsYou have Vim as default editor on your Mac.
You can google about it, I like it much better than nano
If you want to change things back to nano to follow course, here is nice stack post for you
http://superuser.com/questions/503844/git-on-mac-how-to-set-nano-as-the-default-text-editor