.git内存清理方式

  1. 查看前15个大文件
bash 复制代码
git rev-list --objects --all | grep "$(git verify-pack -v .git/objects/pack/*.idx | sort -k 3 -n | tail -15 | awk '{print$1}')"
  1. 删除文件夹(public/housimg文件夹目录)
bash 复制代码
git filter-branch --tree-filter 'rm -rf public/housimg' --tag-name-filter cat -- --all
  1. 回收内存
bash 复制代码
rm -rf .git/refs/original/
git reflog expire --expire=now --all
git fsck --full --unreachable
git repack -A -d
git gc --aggressive --prune=now
  1. 提交变动
bash 复制代码
git push --force --all
相关推荐
CC码码2 小时前
管理你的多个 Git 密钥(多平台多账号)
git·gitlab·github
CC码码2 小时前
管理你的多个 Git 密钥(单平台多账号)
git·gitlab·github
大卫小东(Sheldon)2 小时前
GIM 1.5发布了! 支持Windows系统了
git·ai·rust
flying jiang2 小时前
将大仓库拆分为多个小仓库
git
李boyang10 天前
Git(四):远程操作
git
荻野泽溪10 天前
Git新建分支并同步到远程
git
漫步企鹅10 天前
【Git】新建一个远程分支的常规操作
git·新建远程分支
潇-xiao10 天前
Linux下的版本控制器Git(15)
linux·笔记·git
@昵称不存在10 天前
Git学习
git·学习
pe7er10 天前
⛔️⛔️⛔️丢弃本地commit,强制采用远端代码
git