github / github/gh-classroom

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

Offen
#76 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Go
Sterne
125
Forks
21
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne beim bestehenden Befehl `gh classroom clone` und vergleiche dessen Behandlung der Clone-Flags mit dem dokumentierten Verhalten von `gh repo clone ... -- --depth=1`. Bestätige, dass die angeforderte Option `--mirror` für Studenten-Repositories das Äquivalent zu `git clone --mirror` erzeugt und alle Branches lokal erhält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
git, github, go
Bereich
cli
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.