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?

有帮助吗?

解决方案

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>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top