Home > textmate, Uncategorized, unix > How to make git use TextMate as the default commit editor

How to make git use TextMate as the default commit editor

git config --global core.editor "mate -w"

Now when you do a git commit without specifying a commit message, TextMate will pop-up and allow you to enter a commit message in it. When you save the file and close the window, the commit will go through as normal. (If you have another text editor you prefer instead, just change the “mate -w” line to the preferred one)

For those curious what the -w argument is about, it tells the shell to wait for the mate process to terminate (the file to be saved and closed). Read this for more information about how to associate TextMate with various other shell scripts and programs.

Categories: textmate, Uncategorized, unix Tags: , ,
  1. November 6, 2010 at 3:48 pm

    I had done:

    git config –global core.editor mate

    and kept getting:

    “Aborting commit due to empty commit message.”


    git config –global –unset core.editor
    git config –global –add core.editor “mate -w”

    did the trick. Thanks!

    • i82much
      November 7, 2010 at 7:49 am

      Hey, I’m glad this was useful. It would be nice if there were a more informative error message when you forgot the flag, but alas git would have no way of knowing about it.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: