# git diff - howto exclude dir from diff?

2 messages from 2010-09-06 to 2010-09-06. Participants: Jan III Sobieski, Sylvain Rabot.
Thread: https://gitlist.dev/t/25001

## Jan III Sobieski, 2010-09-06 11:13

Subject: git diff - howto exclude dir from diff?
Message-ID: <AANLkTikUadS+tj3ARdRqo=PSBVhTsJaUxaJv+=4hMf4s@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikUadS%2Btj3ARdRqo%3DPSBVhTsJaUxaJv%2B%3D4hMf4s%40mail.gmail.com

```
Hi,

I wonder if it's possible to exclude a dir from the diff. I want to
get some diffstats from Linux tree

git diff v2.6.35..v2.6.36-rc3 --stat

but without drivers/staging/ dir. Is it possible?

Regards,
Jan

-- 
Jan III Sobieski

```

## Sylvain Rabot, 2010-09-06 13:25

Subject: Re: git diff - howto exclude dir from diff?
Message-ID: <1283779537.23955.5.camel@isis.agematis.loc>
URL: https://gitlist.dev/e/1283779537.23955.5.camel%40isis.agematis.loc
In-Reply-To: <AANLkTikUadS+tj3ARdRqo=PSBVhTsJaUxaJv+=4hMf4s@mail.gmail.com>

```
On Mon, 2010-09-06 at 13:13 +0200, Jan III Sobieski wrote:
> Hi,
> 
> I wonder if it's possible to exclude a dir from the diff. I want to
> get some diffstats from Linux tree
> 

It's not possible to exclude with git diff/grep, but you can do
somtehing like that :

find . -type f ! -path "./drivers/staging/*" | xargs git diff
v2.6.35..v2.6.36-rc3 --stat

> git diff v2.6.35..v2.6.36-rc3 --stat
> 
> but without drivers/staging/ dir. Is it possible?
> 
> Regards,
> Jan
> 

```
