0
Answered

How do I set Textastic as the default git editor?

Alexander Blach (Developer) 4 years ago • updated 4 years ago 0
I want to use Textastic for Mac as the editor for "git commit".

Answer

Answer
Answered
You can use the following command to set Textastic as the editor for git commit:

git config --global core.editor "open -a Textastic \"$@\" -W"

The "-W" switch waits until Textastic is closed, so you need to quit the app (Cmd-Q) to finish the commit.

If you would leave out the "-W" switch, git would try to commit immediately and you'd get the following error message: "Aborting commit due to empty commit message."

You can see a documentation of the command line options when you type "man open".
+1
Answered
You can use the following command to set Textastic as the editor for git commit:

git config --global core.editor "open -a Textastic \"$@\" -W"

The "-W" switch makes git wait until Textastic is closed, so you need to quit the app (Cmd-Q) to finish the commit.

If you would leave out the "-W" switch, git would try to commit immediately and you'd get the following error message: "Aborting commit due to empty commit message."
Answered
You can use the following command to set Textastic as the editor for git commit:

git config --global core.editor "open -a Textastic \"$@\" -W -n"

The "-W" switch waits until Textastic is closed, so you need to quit the app (Cmd-Q) to finish the commit.

If you would leave out the "-W" switch, git would try to commit immediately and you'd get the following error message: "Aborting commit due to empty commit message."

"-n" opens a new instance of the app.

You can see a documentation of the command line options when you type "man open".
Answer
Answered
You can use the following command to set Textastic as the editor for git commit:

git config --global core.editor "open -a Textastic \"$@\" -W"

The "-W" switch waits until Textastic is closed, so you need to quit the app (Cmd-Q) to finish the commit.

If you would leave out the "-W" switch, git would try to commit immediately and you'd get the following error message: "Aborting commit due to empty commit message."

You can see a documentation of the command line options when you type "man open".