Re: Really remove a file ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 yourhistory is now completely rewritten. You should probably have themclone a new copy from the repo you've run this on instead of trying tocontinue working with their old repos. Otherwise all hell breaksloose. You'll probably also want to run "git gc" on your repo toactually get rid of the huge object that was added (or doesfilter-branch do this automatically?).
On Thu, Oct 9, 2008 at 11:56 AM, Alex Riesen <raa.lkml@xxxxxxxxx> wrote:>> 2008/10/9  <marcreddist@xxxxxxx>:> > 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@xxxxxxxxxxxxxxx> More majordomo info at  http://vger.kernel.org/majordomo-info.html��.n��������+%����;��w��{.n��������n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�m


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux