Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以从浅克隆的本地副本中获取提交日志历史记录(--depth = 1)
(--depth = 1)
我在我的 jenkins 构建作业中使用浅克隆来获取代码并构建,但更改日志不完整,因为我使用的是浅克隆。有办法解决吗?
理论上,您可以进行部分浅克隆,其中所有commit对象都被克隆,但tree和blob对象仅被克隆到 1 的深度:
commit
tree
blob
git clone --filter=tree:1 <repo>
但是 Github 不支持这个选项:
fatal: remote error: filter 'tree' not supported (maximum depth: 0, but got: 1)
据我所知,它适用于 GitLab。
你不能。
但如果有帮助,您可以通过git ls-remote获取标签列表(如果您的詹金斯工作想要检查标签)。
莫特