-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize Repository Forking Process #104
Comments
You might not even need all commits from the primary branch (which can be "master") but only the last one.
|
Yes indeed. |
@gounthar I explored about JGit , their docs and community forum and this can be done by JGit , it offers an option like this: |
Thanks @SohamJuneja. 👍 |
@gounthar ohh , didnt check this🥹 , why's the issue still open then? Is there anything needed to be done here? |
My bad, I just launched the tool on pipeline-graph-view, and it forked with the 12 branches. 🤷 |
I guess there's a simple fix , just need to add one line in GHServiceTest.java |
This is not implemented. For example we still fork the repo even if there is no changes to push. So we need only fork before pushing changes (and changing the remote before pushing). |
This is an other optimization I guess. When forking, we probably need to sync only the default branch. Not sure if it's implemented on https://github.com/hub4j/github-api The GitHub allow it : https://docs.github.com/en/rest/repos/forks?apiVersion=2022-11-28#create-a-fork So if it's not available on |
@jonesbusy So , the jgit solution I mentioned won't work here? |
What do you mean ? I would suggest to study the actual solution and understand everything that can be optimized like branches, forking etc... This issue is just an holder for all optimization related to repository forking, cloning etc... |
Thank you for pointing that out. I’ll take a deeper look at both hub4j/github-api and the GitHub REST API for optimizations, including the default_branch_only feature. My initial question was about whether the JGit solution : setCloneAllBranches(false)) could be applied or adapted for use with the hub4j/github-api or if the REST API is a better direction. |
What feature do you want to see added?
Current Situation
When forking a repository on GitHub, our current process retrieves all branches from the original repository.
Issue
This approach may be inefficient and unnecessary for our use case.
Desired Outcome
We aim to fork only the default branch of the repository, as this is typically sufficient for our work.
GitHub GUI Option
The GitHub web interface provides an option to fork only the default branch (usually the main branch).
JGit Consideration
It's unclear whether JGit, the Java library we use for Git operations, offers a similar option to fork only the default branch.
Proposed Solution
Benefits
Next Steps
Conclusion
Optimizing our forking process to retrieve only the main branch will streamline our workflow and improve overall efficiency. This change aligns with best practices for managing forks when only the main branch is needed for development or analysis purposes.
Upstream changes
No response
Are you interested in contributing this feature?
No response
The text was updated successfully, but these errors were encountered: