git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: How to exclude files from "git diff"
Date: Tue, 5 Jan 2010 01:45:09 -0500	[thread overview]
Message-ID: <20100105064509.GC19025@coredump.intra.peff.net> (raw)
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

  reply	other threads:[~2010-01-05  6:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-18 17:09 How to exclude files from "git diff" H.J. Lu
2010-01-05  6:45 ` Jeff King [this message]
2010-01-05 14:20   ` H.J. Lu
2010-01-05 17:54     ` Dmitry Potapov
2010-01-05 18:15       ` H.J. Lu
2010-01-05 18:31         ` Nguyen Thai Ngoc Duy
2010-01-05 18:41         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100105064509.GC19025@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).