github / github/gh-classroom

[gh classroom clone --mirror] Clone repositories using mirror behavior to have all branches locally

Open
#76 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
125
Forks
21
PR merge metrics
No merged PRs in 30d

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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.