Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdate a development team with rewritten Git repo history, removing big files
    primarykey
    data
    text
    <p>I have a git repo with some very large binaries in it. I no longer need them, and I don't care about being able to checkout the files from earlier commits. So, to reduce the repo size, I want to delete the binaries from the history altogether.</p> <p>After a web search, I concluded that my best (only?) option is to use <code>git-filter-branch</code>:</p> <pre><code>git filter-branch --index-filter 'git rm --cached --ignore-unmatch big_1.zip big_2.zip etc.zip' HEAD </code></pre> <p>Does this seem like a good approach so far?</p> <p>Assuming the answer is yes, I have another problem to contend with. The <a href="http://git-scm.com/docs/git-filter-branch" rel="noreferrer">git manual has this warning</a>:</p> <blockquote> <p>WARNING! The rewritten history will have different object names for all the objects and will not converge with the original branch. You will not be able to easily push and distribute the rewritten branch on top of the original branch. Please do not use this command if you do not know the full implications, and avoid using it anyway, if a simple single commit would suffice to fix your problem. (See the "RECOVERING FROM UPSTREAM REBASE" section in git-rebase(1) for further information about rewriting published history.)</p> </blockquote> <p>We have a remote repo on our server. Each developer pushes to and pulls from it. Based on the warning above (and my understanding of how <code>git-filter-branch</code> works), I don't think I'll be able to run <code>git-filter-branch</code> on my local copy and then push the changes.</p> <p>So, I'm tentatively planning to go through the following steps:</p> <ol> <li>Tell all my developers to commit, push, and stop working for a bit.</li> <li>Log into the server and run the filter on the central repo.</li> <li>Have everyone delete their old copies and clone again from the server.</li> </ol> <p>Does this sound right? Is this the best solution?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload