有没有办法清理混帐? [英] Is there a way to clean up git?

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

问题描述

看起来像我的项目越来越大,每个git commit / push 。有没有办法清理我的git文件夹?

解决方案

我不确定你想要什么。首先,当然每次你提交/推送的目录会变得更大一些,因为它必须存储每个额外的提交。



然而,可能你需要 git gc 这将清理不必要的文件并优化本地存储库(

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


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.

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

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

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

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