如何从浅表克隆中获取完整的提交日志? [英] how to get full commit log from a shallow clone?

查看:123
本文介绍了如何从浅表克隆中获取完整的提交日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从作为浅层克隆的本地副本中获取提交日志历史记录,所以(-depth = 1)

Is it possible to get the commit log history from a local copy which is a shallow clone (--depth = 1)

我在jenkins构建作业中使用浅层克隆来获取代码并进行构建,但是由于我在使用浅层克隆,因此变更日志不完整.有办法解决吗?

I am using shallow clone in my jenkins build job to get the code and build but the changelog is not complete because I am using shallow clone. Is there a way around that?

推荐答案

从理论上讲,您可以进行部分浅层的克隆,在其中克隆所有 commit 对象,但克隆 tree blob 对象仅克隆​​到深度1:

In theory you can do a partially shallow clone where all of the commit objects are cloned but the tree and blob objects are only cloned to a depth of 1:

git clone --filter=tree:1 <repo>

但是Github不支持此选项:

However Github does not support this option:

fatal: remote error: filter 'tree' not supported (maximum depth: 0, but got: 1)

据我所知,它可以在GitLab上运行.

It works on GitLab as far as I can tell.

这篇关于如何从浅表克隆中获取完整的提交日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆