[Feature]: SingleBranch: true
in Git Clone Limits Development Environments
#2241
Labels
SingleBranch: true
in Git Clone Limits Development Environments
#2241
Problem
The current implementation of
git.PlainClone(...)
in manager.go#L33 setsSingleBranch: true
, which limits the cloned repository to a single branch. This behavior is suitable for service deployments but is counterproductive for development environments, where access to multiple branches is often required.Observed Issues:
git branch -r
only lists the initially cloned branch).git fetch origin
does not retrieve other branches due to the restricted fetch configuration.Solution
For development environments,
SingleBranch: false
should be used to ensure all branches are fetched. The solution is to conditionally adjust theCloneOptions
based on the use case.Workaround
Until this is fixed, users can manually reconfigure Git after cloning:
Reset the fetch configuration:
git config --unset remote.origin.fetch git config --add remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" git fetch origin --prune
Verify remote branches:
Checkout additional branches manually:
This allows developers to retrieve and switch between all remote branches without re-cloning the repository.
Would you like to help us implement this feature by sending a PR?
No
The text was updated successfully, but these errors were encountered: