git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stefan Karpinski" <stefan.karpinski@gmail.com>
To: marcreddist@aim.com
Cc: git@vger.kernel.org
Subject: Re: Really remove a file ?
Date: Thu, 9 Oct 2008 16:43:11 -0700	[thread overview]
Message-ID: <d4bc1a2a0810091643u3903a1f4h44d3579b98fe6922@mail.gmail.com> (raw)
In-Reply-To: <81b0412b0810091156v15dea27an95050a06cfb4f8df@mail.gmail.com>

Specifically, you probably want to do something like this:

  $ git filter-branch --index-filter 'git update-index --remove
<filename>' --force -- --all

Beware that this will make your repository effectively "incompatible"
with those of others who've pulled from you before—because all of your
history is now completely rewritten. You should probably have them
clone a new copy from the repo you've run this on instead of trying to
continue working with their old repos. Otherwise all hell breaks
loose. You'll probably also want to run "git gc" on your repo to
actually get rid of the huge object that was added (or does
filter-branch do this automatically?).

On Thu, Oct 9, 2008 at 11:56 AM, Alex Riesen <raa.lkml@gmail.com> wrote:
>
> 2008/10/9  <marcreddist@aim.com>:
> > So is there a way to really remove a file in the git repository so that it
> > never existed (I mean not having the diff in the logs and the data stored
> > somewhere in the .git directory) ? Or if it's not the was git is supposed to
> > be used, is there a way to hide the diff (even from git-log) or something ?
>
> Yes. But you'll change the whole history (of course, it should _never_
> mention the file).
> See git filter-branch (there is even an example at the end of its man page.
> Replace mv with rm)
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-10-09 23:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09 18:12 Really remove a file ? marcreddist
2008-10-09 18:56 ` Alex Riesen
2008-10-09 23:43   ` Stefan Karpinski [this message]
2008-10-10  9:38     ` marcreddist
2008-10-10 14:32       ` Björn Steinbrink
2008-10-10 20:50         ` Stefan Karpinski

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=d4bc1a2a0810091643u3903a1f4h44d3579b98fe6922@mail.gmail.com \
    --to=stefan.karpinski@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=marcreddist@aim.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).