Reputation: 1937
When I git commit, I do a $ gcv
which is an alias in my .bash_profile for git commit -v
. The information in that file is great. I like to review what I did so I can make a concise message.
Recently, I figured out how to "colorize" my git output in iTerm2 and it's beautiful. My brain has gotten used to quickly identifying the red and green so I can see the adds and deletes very easily.
Question is: I can see my COMMIT_EDITMSG
file in Sublime, but can I get it to open with the same colorized lines I'm seeing in iTerm2?
Upvotes: 3
Views: 418
Reputation: 91
There is a way! I finally figured it out!
First make sure that you have the subl command for the terminal, and set subl as your git editor (with the -w option): Edit your .bash_profile to look like this:
export EDITOR="/usr/bin/subl -w"
Then do a git commit -v
for the message to open. Inside of the sublimeText2 window, click on the lower right corner where it says Plain Text
and change the option to:
Open all with current extension as > Diff
and you should get colors everytime you get the COMMIT_EDITMSG.
Upvotes: 9