GIT Rebase Fatal on Multiple 0.5GB Binary Files
git, git-rebase
Solution
You won't know if your machine is big enough until failing on the 'git rebase' but by that point your directory is in a munged state. During the rebase another branch was checked out (main) so that the 'secc' changes could be applied to it. Recover, and proceed with:
git checkout secc
Having failed on the rebase, as you've noted you've got two options:
- If rebase is not required, go with 'git merge main'
- Get a bigger machine and retry 'git rebase main'
You don't have a practical option to ignore the 0.5GB files, do the rebase, and then get those giga files back.
Problem
[This question is essentially reopening git crash during rebase which never had an answer] I'm attempting to a rebase from my 'secc' branch as: ``` $ git rebase main First, rewinding head to replay your work on top of it... fatal: Out of memory, malloc failed (tried to allocate 553656577 bytes) # about 0.5 GB $ git rebase --abort No rebase in progress? ``` The failure is related to the fact that both branches and their common ancestor have three .dat files each of which is 0.5 GB. How can I do a rebase in this situation? Additional info: - A 'git merge main' works just fine. - Augmenting .gitattributes with '*.dat merge=keepTheirs' did not prevent the fatal. - The *.dat files do differ. - I'm willing to remove the *.dat files to rebase the others and then add back the *.dat. But how? - I'm using git 1.7.9.4