有没有办法减小git文件夹的大小? [英] Is there a way to reduce the size of the git folder?

查看:133
本文介绍了有没有办法减小git文件夹的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎每个git commit/push的项目都越来越大.有没有办法清理我的git文件夹?

Seems like my project is getting bigger and bigger with every git commit/push. Is there a way to clean up my git folder?

推荐答案

我不确定您想要什么.首先,当然,每次您提交/推送目录时,目录都会变得更大,因为该目录必须存储所有其他提交.

I'm not sure what you want. First of all, of course each time you commit/push the directory is going to get a little larger, since it has to store each of those additional commits.

但是,您可能想要git gc来清理不必要的文件并优化本地存储库"(手册页).

However, probably you want git gc which will "cleanup unnecessary files and optimize the local repository" (manual page).

另一个可能相关的命令是git clean,它将从您的树中删除未跟踪的文件(手册页).

Another possibly relevant command is git clean which will delete untracked files from your tree (manual page).

这篇关于有没有办法减小git文件夹的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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