문제

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