格式:
git gc [--aggressive] [--auto] [--quiet] [--prune=<date> | --no-prune] [--force]
说明:
gc 是garbage collection的缩写。
1、简单指令:
git gc
2、 --aggressive:仔细检查并清理,犹如电脑的全部杀毒,用时较久,一般上100个commit后可以执行,经常执行区别不大:
git gc --aggressive
3、 --auto:大概看一下仓库有没有需要整理,如果情况良好,不执行gc:
git gc --auto
4、—no-prune:不要整理任何零散的文件:
git gc -no-prune
5、–quiet:取消所有进度报告:
git gc --quiet