I have a fairly large Git repository, where "large" refers to both the history size and the file size. I want to clone this repository from my Java application. I am not interested in the full repository history, I just want the code.
On the command line, git clone
for this repository takes about 7 minutes, and doing a shallow clone with git clone --depth 1
takes 12 seconds.
I therefore want to do the same using JGit. However, in JGit both the normal clone and the shallow clone using the option from this SO question both take the full 7 minutes.
Am I correct that JGit can't do a "real" shallow clone and instead emulates this somehow? Of if I'm wrong, is it actually possible to do a shallow clone that is faster than a full clone? I would imagine that faster is the number 1 reason why people want to do shallow clones in the first place.