0

团队,

我正在尝试通过手动编辑 jenkins gui configuration 来搜索用户检查过的字符串。每当我们保存这个 gui 配置时,都会在 gerrit 上直接提交给 master。现在,我想搜索最近 3 天发生的所有提交,看看是谁做出的。

所以当我在下面做时,下载所有天可能需要 30 天的提交。

git clone ssh://git.team.com:29111/jenkins_configuration

我可以说这里有参数吗

--since 3d

这样它只下载那些提交并节省一些时间?

输出:

Cloning into 'jenkins_configuration'...
remote: Counting objects: 204746,

预期产出

Cloning into 'jenkins_configuration' last 3 day commits...
remote: Counting objects: xxx,
4

1 回答 1

0

使用 Git 命令,您可以执行:

git clone --shallow-since=<date> ...

但是,如果您在 Jenkins 上使用 Git 插件,则没有“shallow-since”参数,只有“depth”参数,因此您需要选择固定数量的提交(而不是天数)。它等效于以下 Git 命令:

git clone --depth <depth> ...
于 2020-09-19T19:19:17.993 回答