Re: How to exclude files from "git diff"
- From
Jeff King <peff@peff.net>
- Date
- Jan 5, 2010, 06:45 UTC
- Message-ID
- <20100105064509.GC19025@coredump.intra.peff.net>
- In-Reply-To
- <6dc9ffc80912180909q2e9cbe30r7c802a2152c5954@mail.gmail.com>
On Fri, Dec 18, 2009 at 09:09:15AM -0800, H.J. Lu wrote:
> I have some bookkeeping files in my git repository. How do I > exclude them from "git diff"? Does "git diff" support > > # git diff --exclude="foo.*.bar*"
No, I don't believe there is a way to do that. You would have to do something like:
git diff $(git ls-files | grep -v whatever)
The usual concept of "exclusion" for git is not to track files at all via the .gitignore mechanism. Are these files that have content you really _want_ in the repository, but you just don't want to see them when doing some diffs? Or are they files that could not be in the repository at all?
-Peff