How I can do
git clone --depth 1 ...
with JGIT library?
How I can do
git clone --depth 1 ...
with JGIT library?
You can't, JGit doesn't yet support shallow clones on the client side (it does on the server side, though).
git clone --depth
however is not implemented yet, see bug 475615: Support "git clone --depth" in CloneCommand –
Organizer According to the Release notes for version 6.5.0, this has been released on March 15, 2023.
You can now use any of
.setDepth(Integer)
.setShallowSince(Instant)
.setShallowSince(OffsetDateTime)
for example like so:
Git.cloneRepository().setDepth(1)
© 2022 - 2024 — McMap. All rights reserved.