.git file too large question resolve解决方法

简介: .git file too large question resolve解决方法

git branch-filter来遍历git history tree, 可以永久删除history中的大文件,达到让.git文件瘦身的目的

找出大文件

git verify-pack -v .git/objects/pack/pack-*.idx | sort -k 3 -g | tail -5
ls -lh .git/objects/pack/

第一行的字母其实相当于文件的id,用以下命令可以找出id 对应的文件名

git rev-list --objects --all | grep 8f10eff91bb6aa2de1f5d096ee2e1687b0eab007
git filter-branch --index-filter 'git rm --cached --ignore-unmatch <your-file-name>'
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git fsck --full --unreachable
git repack -A -d
git gc --aggressive --prune=now
git push --force [remote] master
相关文章
|
4月前
|
安全 网络安全 开发工具
百度搜索:蓝易云【git无法使用git协议clone github仓库问题解决方法】
通过尝试以上解决方法,你应该能够解决无法使用Git协议克隆GitHub仓库的问题。选择适合你网络环境和要求的方法,并根据需要进行相应的配置。
186 2
|
1月前
|
开发工具 git
git报错 Unable to create ‘D:/project/xxx/.git/index.lock‘: File exists.
git报错 Unable to create ‘D:/project/xxx/.git/index.lock‘: File exists.
89 1
|
2月前
|
开发工具 git
百度搜索:蓝易云【git生成change-id的解决方法】
请注意,以上方法适用于本地仓库。如果你是在使用Gerrit进行代码审核,Gerrit会自动为每个提交生成Change-Id。如果在使用其他代码托管平台,可能需要根据平台的规范自行生成和添加Change-Id。
34 2
|
3月前
|
存储 缓存 开发工具
Git 拉取合并代码流程和多人协同开发的问题解决方法
Git 拉取合并代码流程和多人协同开发的问题解决方法
66 0
|
6月前
|
开发工具 git
【问题解决】Git命令行常见error及其解决方法
以下是我一段时间没有使用xshell,然后用git命令行遇到的一些系列错误和他们的解决方法
134 0
|
8月前
|
缓存 开发工具 git
Git .gitignore 文件不生效解决方法
Git .gitignore 文件不生效解决方法
185 0
|
10月前
|
开发工具 git
使用Git时遇见问题解决方法汇总
使用Git时遇见问题解决方法汇总
167 0
|
网络安全 开发工具 git
Git 克隆仓库报unable to get local issuer certificate错误解决方法
Git 克隆仓库报unable to get local issuer certificate错误解决方法
822 0
|
开发工具 git
Git冲突:# If this is not correct, please remove the file # .git/MERGE_HEAD
Git冲突:# If this is not correct, please remove the file # .git/MERGE_HEAD
99 0
Git冲突:# If this is not correct, please remove the file # .git/MERGE_HEAD
|
开发工具 git
git clone 失败解决方法:Failed to connect to 127.0.0.1 port 31181 Connection refused
git clone 失败解决方法:Failed to connect to 127.0.0.1 port 31181 Connection refused
695 1
git clone 失败解决方法:Failed to connect to 127.0.0.1 port 31181 Connection refused