Reputation: 435
I discovered that my .gitignore file was not commited into my git repository at all. I have about 300 commits in my repository with a few branches I made: I am using the git flow model so now I have master, develop and a few feature branches
I do not care how but I want to amend the first commit somehow and all versions after it.
as i see it i have two options:
I tried option #1 using this link but on rebase I get this error
$ git rebase --onto newroot --root master
First, rewinding head to replay your work on top of it...
Applying: First Commit
fatal: Out of memory, realloc failed
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 First Commit
The copy of the patch that failed is found in:
c:/Temp/.git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
my biggest file is about 40MB and the whole project size is about 1.6GB. when I ran this command I closed everything running and had about 10GB of free memory (I have 16GB in total).
any ideas how to do this?
Upvotes: 1
Views: 963
Reputation: 36823
Have you tried interactive rebase?
$ git rebase -i --root
Then put "edit" in first commit. There add your new file, then git rebase --continue
, and it will do what you need.
Upvotes: 2
Reputation: 6048
I didn't realize git needed increasing levels of memory for long rebases. Interesting.
You could do the rebase in phases. You don't have to give it master
as the target. You could give it a commit halfway along the branch, or 1/3rd of the way. That won't move the master tag at the end, so you'll have to drop a tag or temp branch name on it, but then you can rebase onto that with the next bit, and do it all in stages that your memory can handle. At the end you can git reset --hard
to move master to the new branch.
Upvotes: 0