0

I have tried all manner of git diff commands.

From using the actual commit hashes:

$ git diff e2951679823lkdasdkjn38 7jhlkdjhlakj3kl2jlj2a90 | mate2

To using two branches:

$ git diff master develop | mate2

Both of which just launch Textmate2 but don't show me the files I want to see.

I would like to be able to do a diff on my Gemfile.lock over the last say two or 3 commits in Textmate. How do I do that?

marcamillion
  • 32,933
  • 55
  • 189
  • 380

1 Answers1

0

Check out mate -h. You can give TM2 a hint on the bundle you want to use with the -t switch. The following compares two branches, piping the output to TextMate in diff mode:

git diff master develop | mate -t source.diff

To see only a single path, you do the following:

git diff master develop -- <paths> | mate -t source.diff

This is a fairly common syntax for a number of other commands as well (like git log). You can read more about it on the git diff manpage:

git diff [options] [<commit>] [--] [<path>…]
git diff [options] --cached [<commit>] [--] [<path>…]
git diff [options] <commit> <commit> [--] [<path>…]
git diff [options] <blob> <blob>
git diff [options] [--no-index] [--] <path> <path>
Jay Allen
  • 465
  • 3
  • 8