git 查找胖提交 [英] git find fat commit

查看:23
本文介绍了git 查找胖提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以获得有关每次提交中的更改浪费了多少空间的信息——这样我就可以找到添加了大文件或大量文件的提交.这一切都是为了减少 git repo 的大小(rebase 和过滤提交)

Is it possible to get info about how much space is wasted by changes in every commit — so I can find commits which added big files or a lot of files. This is all to try to reduce git repo size (rebasing and maybe filtering commits)

推荐答案

忘记回复了,我的回答是:

Forgot to reply, my answer is:

git rev-list --all --pretty=format:'%H%n%an%n%s'    # get all commits
git diff-tree -r -c -M -C --no-commit-id #{sha}     # get new blobs for each commit
git cat-file --batch-check << blob ids              # get size of each blob

这篇关于git 查找胖提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆