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 trialYI JIANG
3,424 PointsCAN'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
5,110 PointsI 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 ???
Kayla Johnson
351 PointsI 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.
Iain Simmons
Treehouse Moderator 32,305 PointsYour text editor in the terminal might be vi
or something else. Try Ctrl + c
or :q
or similar.
Tina Maddox
28,102 PointsWere you able to exit the file?
susannazanatta
8,492 PointsOn a Mac, try 'esc' key and then type :exit
Shunsuke Taguchi
9,380 PointsI'm having a same trouble now and your advice works ! Thanks.
Leon Segal
14,754 PointsAfter 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
682 PointsAfter 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
5,110 PointsDid you figure it out?
Mars Epaecap
5,110 Pointsvi 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
28,102 PointsTo 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!
Wojciech Zaorski
16,387 PointsWojciech Zaorski
16,387 PointsThanks mate! This helped a lot.