是否可以从浅克隆的本地副本获取提交日志历史记录 (--depth = 1)
我在我的 jenkins 构建作业中使用浅层克隆来获取代码和构建,但更改日志不完整,因为我使用的是浅层克隆。有办法解决吗?
最佳答案
理论上,您可以进行部分浅克隆,其中克隆所有 commit
对象,但仅克隆 tree
和 blob
对象深度为 1:
git clone --filter=tree:1 <repo>
但是 Github 不支持这个选项:
fatal: remote error: filter 'tree' not supported (maximum depth: 0, but got: 1)
据我所知,它可以在 GitLab 上运行。
关于git - 如何从浅克隆中获取完整的提交日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30158978/