Git commit opens blank text file, for what?

Alex picture Alex · Sep 13, 2008 · Viewed 77.9k times · Source

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. None of the tutorials seem to address this, so I don't know what to do with the file or what to put in it if anything.

Answer

vikhyat picture vikhyat · Feb 10, 2009

You're meant to put the commit message in this text file, then save and quit.

You can change the default text editor that git uses with this command:

git config --global core.editor "nano"

You have to change nano to whatever command would normally open your text editor.