threads / discuss / 25001

git diff - howto exclude dir from diff?

Subject: git diff - howto exclude dir from diff?

## tl;dr

2 messages between Sep 6, 2010 and Sep 6, 2010.

replies: 1people: 2as markdown or json

Jan III Sobieski· Sep 6, 2010, 11:13 UTC · lore
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· Sep 6, 2010, 13:25 UTC · re: Jan III Sobieski · lore

Re: git diff - howto exclude dir from diff?

On Mon, 2010-09-06 at 13:13 +0200, Jan III Sobieski wrote:
Show 5 quoted lines
> 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

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

← back to recent threads