I have my editor setup to be textmate but when I do a git diff it uses vi to show me the diff output, is there any way to set it to show the diff in textmate?
4 Answers
I normally pipe the contents to mate like this:
git diff | mate -
-
3Also, just as an interesting point: you don't need to specify the
-
when piping tomate
becausemate
reads from stdin when run with no parameters.– rfundukOct 22, 2009 at 22:03 -
1For some reason when I look at (git) diff output saved as a file using TextMate, there's nice coloring. When I pipe the output of git to mate like this, the coloring is omitted. Not sure what's going on here. Feb 2, 2011 at 23:22
-
Yeah that has been bothering me too. TextMate doesn't always show it with the proper diff formatting. Seems to default back to last one it used. Maybe we should pipe it to a .diff file in /tmp and then mate that? Jul 1, 2012 at 21:46
The GIT_PAGER
environment variable is used to specify which program to use to show multi-page output. You should be able to set this to point to textmate.
-
1Thanks, I was looking for this. Here's the git config equivalent: git config --global core.pager "/usr/bin/mate" Jun 9, 2009 at 4:21
If you have the Terminal link installed it's simple:
git diff | mate
I personally have an alias setup that maps 'diffmate' to that command.
Also, it should be pointed out that, within TextMate, one can use Bundles>>Diff to perform the comparison within TextMate.