Skip to content
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

Request: enable cloning with --single-branch #24

Open
AndydeCleyre opened this issue Mar 7, 2025 · 2 comments
Open

Request: enable cloning with --single-branch #24

AndydeCleyre opened this issue Mar 7, 2025 · 2 comments
Assignees

Comments

@AndydeCleyre
Copy link

Hello, and thanks!

Sometimes repos have extra branches which take up extra space and bandwidth, for example for documentation websites. I'd like to be able to skip handling all that by checking out the repos with git clone's --single-branch option.

Three approaches I can think of, any of which would be great:

  • Always use --single-branch
  • Use --single-branch only when @branchname is used
  • Use --single-branch when some new option to the load subcommand is used
@AndydeCleyre
Copy link
Author

I'll add that an alternative solution would be a "degit" option like zimfw's.

@agkozak
Copy link
Owner

agkozak commented Mar 11, 2025

Thanks, @AndydeCleyre ! @sergiorussia has proposed using shallow (--depth 1) clones, and I've got an experimental branch depth1, but I've been holding off making it official because I haven't decided exactly how it should work yet. We made shallow clones the default behavior for now (almost all the time -- it's complex -- you can see the discussion), but plugin authors will want to be able to opt out of that.

Your --single-branch proposal seems closely related, the idea being just to download less stuff. I'll take it into account as I decide what to do next.

P.S. @zimfw's degit looks very clever!

@agkozak agkozak self-assigned this Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants