Pregunta

I am following along in a video on treehouse, and in the my_really_cool_projects folder we are using git commit for the first time.

In the video, they use git commit and it opens up in nano. On my mac, it opens in VIM. I can't figure out what to do next? I don't know the vim shortcut for Save.

At any rate, I'd like to be able to open git commit in nano so I can follow the tutorials.

In addition to this, I now have a different problem in that if I try to run git commit again, I get:

Swap file ".git/.COMMIT_EDITMSG.swp" already exists!

Can someone help me get back on track?

¿Fue útil?

Solución

The command to save and exit in vim is :x, however, you might want to use an editor you are familiar with first. I don't know what is the default editor in OS X, but you can tell Git to use that with:

git config --global core.editor <myeditor>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top