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

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

问题描述

有没有可能获得有关每个提交更改浪费了多少空间的信息 - 所以我可以找到增加大文件或大量文件的提交。这是所有尝试减少git回购大小(rebasing和可能过滤提交)

解决方案

忘记回复,我的答案是:

  git rev-list --all --pretty = format:'%H%n%an%n%s'#获取所有提交
git diff-tree -r -c -M -C --no-commit-id#{sha}#为每次提交获取新的blob
git cat-file --batch-check << blob ids#获取每个blob的大小


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天全站免登陆