How to Fork and Clone Only the Default Branch Using JGit [message #1872980] |
Mon, 02 December 2024 14:39  |
Eclipse User |
|
|
|
I am looking to optimize the forking process using JGit by limiting it to fetch and clone only the default branch (e.g., main) of a repository instead of all branches.
Problem:
Currently, JGit retrieves all branches during the clone operation, which is unnecessary for our workflow and increases data transfer and storage usage.
Objective:
I want to ensure that only the default branch is forked and cloned, similar to the option available in the GitHub web interface.
Questions for the Community:
Is there a JGit feature or method that allows fetching only the default branch during the clone operation?
If no such feature exists, are there any best practices or workarounds to achieve this while continuing to use JGit?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02921 seconds