[gh classroom clone --mirror] Clone repositories using mirror behavior to have all branches locally
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start at the existing gh classroom clone command and compare its clone-flag handling with the documented gh repo clone ... -- --depth=1 behavior. Confirm the requested --mirror option produces the equivalent of git clone --mirror for student repositories and preserves all branches locally.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
When cloning student-repos repositories for archives purpose it is necessary to get all the branches locally so that the content on Github can be removed safely.
Similarly if the assignment tolerate or require to provide multiple branches then it would benefit of having all branches locally when cloning repositories instead of pulling them afterwards from remote repository.
Describe the solution you'd like
When using the existing gh classroom clone command the possibility to add --mirror option which would reflect the usage of git clone --mirror https://git-scm.com/docs/git-clone#Documentation/git-clone.txt-code--mirrorcode
Describe alternatives you've considered
Scripting outside of gh cli using git directly to clone the repositories.
Additional context
Given that the underlying gh cli support adding git flags on the command line for clone operation it could be resolved by exposing this feature in gh-classroom cli. This solution would also resolves https://github.com/github/gh-classroom/issues/15
https://cli.github.com/manual/gh_repo_clone
# Clone a repository with additional git clone flags
$ gh repo clone cli/cli -- --depth=1
- Dominant language
- Go
- Stars
- 126
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/gh-classroom
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
github/gh-classroom#95 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
github/gh-classroom#21 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
github/gh-classroom#116 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
github/gh-classroom#110 ·
-
Sanitize Team name Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
github/gh-classroom#109 ·
All issues in github/gh-classroom
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
googleapis/librarian#7670 · 2 comments ·