git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Potapov <dpotapov@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: How to exclude files from "git diff"
Date: Tue, 5 Jan 2010 20:54:08 +0300	[thread overview]
Message-ID: <37fcd2781001050954y778ba661n7cee6cda699968c2@mail.gmail.com> (raw)
In-Reply-To: <6dc9ffc81001050620q55c23072p93f58c8685d77f9d@mail.gmail.com>

On Tue, Jan 5, 2010 at 5:20 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>
> Yes, I want those files in repository. They are for my personal use only.

If you modified some file locally and do not want to see and commit
those modifications, you may want to use:

git update-index --assume-unchanged foo

After that, git will not notice any change to `foo'. So, 'git diff' and any
other command (such git commit -a) will ignore those changes.

Warning: using  --assume-unchanged may result in losing your changes
if you switch between branches containing different versions of 'foo'.

Normally, when you try to do that, git will not allow switch to another
branch saying that `foo' is modified. But using --assume-unchanged
disables this check. But if you have the same `foo' on all branches
then switching between branches will preserve your modifications.


Dmitry

  reply	other threads:[~2010-01-05 17:54 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
2010-01-05 14:20   ` H.J. Lu
2010-01-05 17:54     ` Dmitry Potapov [this message]
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=37fcd2781001050954y778ba661n7cee6cda699968c2@mail.gmail.com \
    --to=dpotapov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hjl.tools@gmail.com \
    --cc=peff@peff.net \
    /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).