Reputation: 1267
How I can do
git clone --depth 1 ...
with JGIT library?
Upvotes: 28
Views: 7452
Reputation: 4663
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)
Upvotes: 6
Reputation: 329
You can't, JGit doesn't yet support shallow clones on the client side (it does on the server side, though).
Upvotes: 16