how to get full commit log from a shallow clone?
Asked Answered
L

2

5

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

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?

Loraleeloralie answered 11/5, 2015 at 2:52 Comment(2)
Why do you want to see your Git log beyond 1 commit? By definition, the older commits are not there.Vanna
I am also using the hockeyapp plugin and passing the changelog as release notes. and using shallow clone, the change log does not includes all the changes done in the build.Loraleeloralie
V
3

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>

However Github does not support this option:

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

It works on GitLab as far as I can tell.

Verlaverlee answered 1/7, 2020 at 20:49 Comment(0)
H
1

No you cannot.

But if it helps, you can get a list of tags (if your jenkins job wants to check a tag) via git ls-remote.

Mort

Hadron answered 11/5, 2015 at 3:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.