| Crates.io | gitfile |
| lib.rs | gitfile |
| version | 0.1.0 |
| created_at | 2025-12-03 10:49:20.246629+00 |
| updated_at | 2025-12-03 10:49:20.246629+00 |
| description | gitfile stat |
| homepage | |
| repository | https://github.com/007gzs/gitfile/ |
| max_upload_size | |
| id | 1963817 |
| size | 53,115 |
gitfile 是一个高效的 Git 仓库分析工具,专为解析 Git 仓库的 .git 目录设计,可统计所有历史出现过的文件路径、定位特定 OID 对应的 Git 对象,并展示 Git 各类对象(Commit/Tree/Blob/Tag)的数量和大小统计信息。
cargo install gitfile
docker pull 007gzs/gitfile
| 参数 | 说明 | 默认值 |
|---|---|---|
root_path (必填) |
扫描的根目录(支持传入多个目录) | - |
-d/--max-depth |
最大递归深度(0 表示不递归,仅扫描指定目录) | 0 |
-s/--show-object |
开启「显示所有 Git 对象」模式(输出每个对象的 OID、类型、大小) | false |
-f/--find-oid |
根据指定 OID 查找对应的 Git 对象,输出其位置和父级对象信息 | 空 |
-t/--thread-num |
线程数(0 表示自动使用 CPU 核心数,最大值 255) | 0 |
--version |
查看版本信息 | - |
--help |
查看帮助信息 | - |
# 本地安装版
gitfile /path/to/your/repo/.git
# Docker 版(需挂载主机目录到容器)
docker run --rm -v /host/path/to/repo:/repo 007gzs/gitfile /repo/.git
# 本地安装版
gitfile -d 3 /path/to/root/directory
# Docker 版
docker run --rm -v /host/path/to/root:/root 007gzs/gitfile -d 3 /root
# 本地安装版
gitfile -f 1a2b3c4d5e6f7890abcdef1234567890abcdef12 /path/to/repo/.git
# Docker 版
docker run --rm -v /host/path/to/repo:/repo 007gzs/gitfile -f 1a2b3c4d5e6f7890abcdef1234567890abcdef12 /repo/.git
# 本地安装版
gitfile -s /path/to/repo/.git
# Docker 版
docker run --rm -v /host/path/to/repo:/repo 007gzs/gitfile -s /repo/.git
# 本地安装版
gitfile -t 8 /path/to/repo/.git
# Docker 版
docker run --rm -v /host/path/to/repo:/repo 007gzs/gitfile -t 8 /repo/.git
本项目基于 MIT 或 Apache-2.0 双许可证开源,详见项目根目录的 LICENSE 文件。