RE: [EXTERNAL] Re: Removing data from repository
- Date: Thu, 24 Jan 2019 15:28:42 +0000
- From: Naum Derzhi <Naum.Derzhi@xxxxxxxxxxxxxxx>
- Subject: RE: [EXTERNAL] Re: Removing data from repository
Chief Scientific Adviser, Physics
3000 N Sam Houston Pkwy E, Technology Center, Office T1241H
Houston, TX 77032
Office: +1 (281) 871 3278
Follow Halliburton: LinkedIn | Facebook | Twitter | YouTube | Blog
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.
From: Paul Smith <paul@xxxxxxxxxxxxxxxxx>
Sent: Thursday, January 24, 2019 9:23 AM
To: Naum Derzhi <Naum.Derzhi@xxxxxxxxxxxxxxx>; git@xxxxxxxxxxxxxxx
Subject: [EXTERNAL] Re: Removing data from repository
External Sender: Use caution with links/attachments.
On Thu, 2019-01-24 at 14:51 +0000, Naum Derzhi wrote:
> I have this problem: years ago one of our developers committed a large
> (Gigabytes) piece of binary data into our project repository.
> This should not have been done, but it happened. (Honest, it was not
> me). We never needed this data in the repository.
> Using git rm removes these files from the working tree, but they are
> still somewhere in the repository, so when we clone, we transfer
> gigabytes of unneeded data.
> Is it possible to fix this problem?
It is possible, but it isn't pretty. By waiting so long to try to fix it you've compounded the impacts dramatically unfortunately. By removing that file you will in effect be rewriting the history of your repository starting with the commit that introduced the problematic file, that will be removed, all the way forward.
That means that every clone of the repository will have to be, at the very least, "hard-reset" and preferably (to avoid accidentally re- introducing the bad file) re-cloned from scratch.
As for actually removing the file, you can find information on how to do this all over the Google. Here's some reasonable advice from