github / github/gh-classroom

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

Aperta
#76 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Go
Stelle
125
Fork
21
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal comando esistente `gh classroom clone` e confronta la gestione dei flag di clonazione con il comportamento documentato di `gh repo clone ... -- --depth=1`. Conferma che l’opzione richiesta `--mirror` produca l’equivalente di `git clone --mirror` per i repository degli studenti e conservi localmente tutti i branch.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
git, github, go
Ambito
cli
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.