Reducing Git traffic from Bitbucket in Jenkins – best practices?

Hello everyone,

I’m using the Jenkins Git Plugin (v5.7.0) to fetch repositories from Bitbucket.

I want to reduce network traffic and clone time, but shallow clone is not considered a best practice for our pipelines (due to history-dependent steps like changelogs, versioning, and some plugins).

I also tried setting depth to 10–20, but in practice it does not significantly reduce the data transfer for our repositories.

My question:
What are the recommended or proven approaches to reduce Git data transfer in Jenkins without relying on shallow clone?

Things I’ve considered / tried:

  • Shallow clone with small depth (not sufficient, not preferred)

  • Standard Git plugin checkout (full history – too heavy)
    Any real-world experience or best-practice recommendations would be greatly appreciated.

    Thanks in advance.

Reference repositories are the most effective way to reduce traffic between the git server and the Jenkins agent. Shallow clone can also help. Git large file support can also help, if it is available and fits your use case.

Refer to “Git in the Large”

Refer also to “Jenkins hints for large git repositories”:

The documentation of the git plugin describes those advanced clone behaviors.