[git] .git文件夹过大 depth指令测试

项目中,客户使用git当作ftp传excel等文件。考虑如何不干涉客户的情况下解决。

找到 git clone --depth 1 这种方式。但不知道后续更新有无影响,故做如下测试。

[git] .git文件夹过大 depth指令测试_第1张图片
image.png

对同一版本库做不同指令的克隆。完成后查看日志。


[git] .git文件夹过大 depth指令测试_第2张图片
image.png

可以看到,没有使用depth 的确实会下载所有的记录。下面在depth的仓库使用fetch试一下。


[git] .git文件夹过大 depth指令测试_第3张图片
image.png

发现多了一个depth 配置。
执行指令 git.exe fetch -v --progress --depth 1 "origin"
再次查看log,果然还是只有一条。

使用depth 重新clone版本库,并修改更新脚本 git fetch --depth 1
git reset --hard origin/master

你可能感兴趣的:([git] .git文件夹过大 depth指令测试)