Hacker News new | past | comments | ask | show | jobs | submit login

If you use textmate:

  git diff | mate -



It works without the trailing slash too, if you want to save a couple of keystrokes.

    git diff | mate


What is the trailing slash for?


A lot of command-line programs that operate on files take '-' as placeholder for stdin or stdout. For example:

  wget -O - 'http://news.ycombinator.com' | less
The -O option is for specifying an output file, but the '-' says to dump the contents to stdout.


Funny; I always use the curl command for that kind of thing, since it automatically pipes to stdout -- but there's something fun you can do with that, too:

    curl http://example.com/foo.tar.gz | tar zxf -
Tar's input file is "-", which means stdin. This downloads and decompresses a tarball to the current directory, without creating a temporary file that I have to delete later.


Thanks! Always enjoy adding to my command line tool belt.


- = dash not slash


You can also change your git options to use a different diff tool.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: