Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT Rebase Fatal on Multiple 0.5GB Binary Files

Tags:

git

git-rebase

[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
like image 804
GoZoner Avatar asked Apr 15 '12 23:04

GoZoner


People also ask

Why we should not use git rebase?

Rebasing can be dangerous! Rewriting history of shared branches is prone to team work breakage. This can be mitigated by doing the rebase/squash on a copy of the feature branch, but rebase carries the implication that competence and carefulness must be employed.

Is rebase safer than merge?

Merging is a safe option that preserves the entire history of your repository, while rebasing creates a linear history by moving your feature branch onto the tip of main .

Can I rebase multiple times?

Yes, you can rebase more than once. After rebasing, you get a fresh set of commits. These commits are exactly like all other commits and hold no record of having been rebased. The main thing you need to be careful for is the possibility of rebase conflicts.

Is rebase better than merge?

Rebasing is better to streamline a complex history, you are able to change the commit history by interactive rebase. You can remove undesired commits, squash two or more commits into one or edit the commit message. Rebase will present conflicts one commit at a time whereas merge will present them all at once.


1 Answers

In the comments you've said that doing the same with a computer that contains more, in this case 32GB, memory has resolved the issue. Based on that, I would conclude that you just had too little memory available to do this on the machine you first tried it with.

like image 119
eis Avatar answered Oct 02 '22 12:10

eis