470

Git瘦身,删除历史大文件

找到大文件

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

查看文件路径

git rev-list --objects --all | grep <ID>

查看前因后果,历史提交。以public/test.mp4为例

git log --pretty=oneline --branches -- public/test.mp4

如果需要知道commit id所在的分支,使用命令

git branch -a --contains <COMMIT ID>

删除大文件

22708

gogs搭建私有git服务器

安装mysql

参见之前的文章:https://dotatong.cn/index.php/archives/1/

安装gogs

二进制文件官方地址 https://gogs.io/docs/installation/install_from_binary