我有一个回购协议https://bitbucket.org/ https://bitbucket.org/
几天前,由于错误,大量图像文件被推送到存储库中。然后文件通过另一次推送被删除。之后该存储库工作正常,但今天当我尝试从存储库中提取时:
$ git pull
Password for 'https://[email protected] /cdn-cgi/l/email-protection':
warning: no common commits
remote: Counting objects: 4635, done.
remote: Compressing objects: 100% (1710/1710), done.
fatal: Out of memory, malloc failed (tried to allocate 4266852665 bytes)
fatal: index-pack failed
我试过了:
git config --global pack.windowMemory 1024m
- $ git 计数对象 -v
数量:9
尺寸:48
包装内:4504
包:1
尺寸包装:106822
可修剪包装:0
垃圾:0
运气不好,不知道接下来我应该采取什么行动......
代码库的大小应该在 10-20m 左右。接下来我应该采取什么行动?
UPDATE 1
我执行了这些命令:
$ git filter-branch --index-filter 'git rm --cached --ignore-unmatch public/images/*' HEAD
Rewrite a1c9fb8324a2d261aa745fc176ce2846d7a2bfd7 (288/288)
WARNING: Ref 'refs/heads/master' is unchanged
and
$ git push --force --all
Counting objects: 4513, done.
Compressing objects: 100% (1614/1614), done.
Writing objects: 100% (4513/4513), 104.20 MiB | 451 KiB/s, done.
Total 4513 (delta 2678), reused 4500 (delta 2671)
remote: bb/acl: ayermolenko is allowed. accepted payload.
To https://[email protected] /cdn-cgi/l/email-protection/repo.git
+ 203e824...ed003ce demo -> demo (forced update)
+ d59fd1b...a1c9fb8 master -> master (forced update)
然后拉就可以了:
$ git pull
Already up-to-date.
但是当我尝试克隆仓库时我得到了
~/www/clone$ git clone [email protected] /cdn-cgi/l/email-protection:repo.git
Cloning into 'clone'...
remote: Counting objects: 5319, done.
remote: Compressing objects: 100% (1971/1971), done.
fatal: Out of memory, malloc failed (tried to allocate 4266852665 bytes)
fatal: index-pack failed
UPDATE 2
遗憾的是我没有找到所有大文件。有些还剩下。所以我要求支持人员删除存储库的所有日志
UPDATE 3
最后我不得不杀死旧的并创建一个新的存储库。