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

YI JIANG
YI JIANG
3,424 Points

CAN'T EXIT THE FILE

after I write down add a readme file,How could go back? I click ctrl x its still here

9 Answers

Mars Epaecap
Mars Epaecap
5,110 Points

I had trouble with this too its very frustrating. I'm on a mac following along on my terminal not a work space and the default editor that opens with git commit is vi.

To change it to nano (the same thing as the instructor) use the command

git config --global core.editor "nano"

next time you do git commit your screen will be like his and then to save and exit ctrl+x then Y then enter will work.

vi might be your default text editor too you can switch to nano, or you can use vi.

These are commands for vi http://gerardable.com/wp-content/uploads/2014/12/10_05_03_vihelpsheet_790x400.jpg

Here is a guide for vi http://www.howtogeek.com/102468/a-beginners-guide-to-editing-text-files-with-vi/

you can also type in the terminal

vi -help

or

nano -help

for a list of commands

GL guys keep going don't give up ???

Thanks mate! This helped a lot.

Kayla Johnson
Kayla Johnson
351 Points

I had the same problem. Had to google what to do. http://stackoverflow.com/questions/7080803/how-can-i-commit-files-with-git this seemed to help. Easily the worst tutor so far in my treehouse experience. He doesn't slow down or explain anything at all.

Your text editor in the terminal might be vi or something else. Try Ctrl + c or :q or similar.

Tina Maddox
Tina Maddox
28,102 Points

Were you able to exit the file?

On a Mac, try 'esc' key and then type :exit

Shunsuke Taguchi
Shunsuke Taguchi
9,380 Points

I'm having a same trouble now and your advice works ! Thanks.

After hitting ctrl-x, did you then hit 'y', then 'enter' to save the changes?

It won't exit until you do that; that could be the issue?

nits ain
nits ain
682 Points

After commit command and adding comment "Added a README file" I am not able to exit the nano editor. After hitting ctrl-x, then I hit 'y', then 'enter' to save the changes, and then click ctrl-c. Yet I am not able to exit.The worst tutor so far in my treehouse experience. He doesn't slow down or explain anything at all.

Mars Epaecap
Mars Epaecap
5,110 Points

Did you figure it out?

Mars Epaecap
Mars Epaecap
5,110 Points

vi might be your default text editor scroll up to see how to switch it to nano (what the instructor uses) if you want to use vi, you can

These are commands for vi http://gerardable.com/wp-content/uploads/2014/12/10_05_03_vihelpsheet_790x400.jpg

Here is a guide for vi http://www.howtogeek.com/102468/a-beginners-guide-to-editing-text-files-with-vi/

you can also type in the terminal

vi -help

or

nano -help

for a list of commands

Tina Maddox
Tina Maddox
28,102 Points

To exit the vi editor you will need to hit esc, :, thenq This will exit the editor. You will need to retype the commit message but be sure to type `git commit -m "put your commit message here so the vi editor will not initiate"

Hope this helps!