仓库过大的问题 #1

Closed
opened 4 months ago by lxb · 2 comments
lxb commented 4 months ago
Owner

之前有一次提交不小心把pyinstaller导出的结果提交到仓库里了,导致现在仓库很大。看看有没有办法把这个问题解决一下。

之前有一次提交不小心把pyinstaller导出的结果提交到仓库里了,导致现在仓库很大。看看有没有办法把这个问题解决一下。
lxb commented 3 weeks ago
Poster
Owner

已解决,仓库大小从一百多MB缩小到2MB以内。大致步骤如下:

# 不知道哪个文件大,查找路径
git rev-list --objects --all | \
  git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | \
  grep '^blob' | \
  sort -k3 -n -r | \
  head -n 20


# 删除对应路径
git filter-repo --path client --invert-paths
git filter-repo --path server --invert-paths


# 提交
git push origin --force --all
git push origin --force --tags
已解决,仓库大小从一百多MB缩小到2MB以内。大致步骤如下: ```bash # 不知道哪个文件大,查找路径 git rev-list --objects --all | \ git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | \ grep '^blob' | \ sort -k3 -n -r | \ head -n 20 # 删除对应路径 git filter-repo --path client --invert-paths git filter-repo --path server --invert-paths # 提交 git push origin --force --all git push origin --force --tags ```
lxb closed this issue 3 weeks ago
lxb commented 3 weeks ago
Poster
Owner

但是现在gitea网页上显示的大小还是很大,实际上仓库clone下来已经变小了

但是现在gitea网页上显示的大小还是很大,实际上仓库clone下来已经变小了
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.