Question: I'm new to git on OS X, and I'm using it via the command line. I come from the world of Tortoise SVN and Beyond Compare on Windows.

I want to be able to send diffs to FileMerge.

I was able to do this with TextMate simply by using:

```
git diff | mate

```

But I'm not sure how to get that set up so I can use FileMerge instead?

Answer: 
Although it's not exactly the same as piping stdin into a script, you can do this:

```
git difftool -t opendiff -y

```

That will launch FileMerge once for each file. Doing the whole project tree at once [takes a little scripting](http://kerneltrap.org/mailarchive/git/2007/11/21/435536).

See also [this question](https://stackoverflow.com/questions/255202).
I don't know what's happening to me since I updated OS X and now opendiff is not working as it used to be.
So I copied this script from [here](https://gist.github.com/miner/e73fc98a83a8fe05d9ef000d46d68a9f) and it worked.

```
#!/bin/sh 
dir=$PWD
until [ -e "$dir/.git" ]; do
  if [ "$dir" == "/" ]; then
    echo "Not a git repository" >&2
    exit 1;
  fi
  dir=`dirname "$dir"`
done
open -a FileMerge -n -W --args -left "$dir/$1" -right "$2" -merge "$5"

```