# how to get 'git diff' to output patch to file

2 messages from 2009-05-14 to 2009-05-14. Participants: Aaron Gray, Alex Riesen.
Thread: https://gitlist.dev/t/19348

## Aaron Gray, 2009-05-14 11:52

Subject: how to get 'git diff' to output patch to file
Message-ID: <93C432AD0B8F4D25A19E0D67C535376A@HPLAPTOP>
URL: https://gitlist.dev/e/93C432AD0B8F4D25A19E0D67C535376A%40HPLAPTOP

```
How do I get 'git diff -u' to output to a file or standard out instead of 
its viewer ?

Many thanks in advance,

Aaron

```

## Alex Riesen, 2009-05-14 12:03

Subject: Re: how to get 'git diff' to output patch to file
Message-ID: <81b0412b0905140503n527d6a3ah34f4cdb72b0ce4c@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0905140503n527d6a3ah34f4cdb72b0ce4c%40mail.gmail.com
In-Reply-To: <93C432AD0B8F4D25A19E0D67C535376A@HPLAPTOP>

```
2009/5/14 Aaron Gray <aaronngray.lists@googlemail.com>:
> How do I get 'git diff -u' to output to a file or standard out instead of
> its viewer ?
>
  git diff -u > file
  GIT_PAGER=: git diff -u (stdout)

or, depending on how old your Git is

  git --no-pager diff -u

```
