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 Committing Changes

Jason Choi
.a{fill-rule:evenodd;}techdegree seal-36
Jason Choi
Front End Web Development Techdegree Graduate 21,159 Points

Commit doesn't work on Mac Terminal

I'm using the Terminal on my Mac. Everything works well but when I type "git commit", nano text editor doesn't open and some different software opens. I can type the descriptions but there is no command to quit or save (ctrl q or ctrl x doesn't work either).

2 Answers

Ari Misha
Ari Misha
19,323 Points

Hiya there! Commit is the step for committing all your changes. Its kinda like a final step. To commit changes , type git commit -m "Initial Commit"in the terminal. The -m flag means with message. Now this flag really important Since you'll be makin multiple commits in the future. And when you'll do git log you'll see the commit with the message. I hope it helped! (:

~ Ari

Warren Reader
Warren Reader
5,930 Points

What's likely happening is when you're submitting the commit, instead of nano opening, another text editor called vim opens. To permanently fix this so nano is your default editor when using git, run the command git config --global core.editor "nano"

You could also use the flag -m to add your commit message without having to open a text editor.