Git commit opens blank text file, for what?

前端 未结 17 939
长情又很酷
长情又很酷 2020-12-22 18:33

In all the Git tutorials I\'ve read they say that you can do:

git init
git add .
git commit

When I do that I get a big text file opened up.

17条回答
  •  自闭症患者
    2020-12-22 19:00

    For those of you using OS X I found this command to work well:
    git config --global core.editor "open -t -W"

    which will force git to open the default text editor (textedit in my case) and then wait for you to exit the application. Keep in mind that you need to "Save" and then "Quit" textedit before the commit will go through. There are a few other commands you can play around with as detailed on this page:

    Apple Developer Library - Open Command

    You can also try git config --global core.editor "open -e -W" if you want git to always open textedit regardless of what the default editor is.

提交回复
热议问题