From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id D73761F619 for ; Mon, 16 Mar 2020 18:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732303AbgCPScu (ORCPT ); Mon, 16 Mar 2020 14:32:50 -0400 Received: from vps.thesusis.net ([34.202.238.73]:48348 "EHLO vps.thesusis.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731967AbgCPSct (ORCPT ); Mon, 16 Mar 2020 14:32:49 -0400 Received: from localhost (localhost [127.0.0.1]) by vps.thesusis.net (Postfix) with ESMTP id 17CBA2AEA6; Mon, 16 Mar 2020 14:32:49 -0400 (EDT) Received: from vps.thesusis.net ([127.0.0.1]) by localhost (ip-172-26-1-203.ec2.internal [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id obTaFkHoRKA0; Mon, 16 Mar 2020 14:32:47 -0400 (EDT) Received: by vps.thesusis.net (Postfix, from userid 1000) id C9C3B2AEA5; Mon, 16 Mar 2020 14:32:46 -0400 (EDT) References: <5B2FEA46-A12F-4DE7-A184-E8856EF66248@jramsay.com.au> <20200315221940.bdgi5mluxuetq2lz@doriath> User-agent: mu4e 0.9.18; emacs 25.2.2 From: Phillip Susi To: Damien Robert Cc: James Ramsay , git@vger.kernel.org Subject: Re: [TOPIC 3/17] Obliterate In-reply-to: <20200315221940.bdgi5mluxuetq2lz@doriath> Date: Mon, 16 Mar 2020 14:32:46 -0400 Message-ID: <87lfo0881d.fsf@vps.thesusis.net> MIME-Version: 1.0 Content-Type: text/plain Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Damien Robert writes: > My situation: coworkers push big files by mistake, I don't want to rewrite > history because they are not too well versed with git, but I want to keep > *my* repo clean. > > Partial solution: > - identify the large blobs (easy) > - write a replace ref (easy): > $ git replace b5f74037bb91 $(git hash-object -w -t blob /dev/null) > and replace the file (if it is still in the repo) by an empty file. > > Now the pain points start: > - first the index does not handle replace (I think), so the replaced file > appear as changed in git status, even through eg git diff shows nothing. Instead of replacing the blob with an empty file, why not replace the tree that references it with one that does not? That way you won't have the file in your checkout at all, and the index won't list it so status won't show it as changed.