Allow `gh repo clone` to grab all upstream branches
- 主要语言
- Go
- 星标
- 46.3k
- 派生
- 9k
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 97
描述
### Describe the feature or problem you’d like to solve
I just ran `gh repo clone` on a fork I had of another project. `gh` helpfully added the upstream repo for me. Cool! However, I was only getting the default branch from upstream, not any of the others. I ended up needing to modify .git/config and change the `fetch` parameter in the `[remote "upstream"]` section from `fetch = +refs/heads/master:refs/remotes/upstream/master` to `fetch = +refs/heads/*:refs/remotes/upstream/*`.
### Proposed solution
I'd like to see a flag (or something) to allow setting the upstream repo to fetch everything.
### Additional context
It looks like the default was changed in https://github.com/cli/cli/issues/2557. I prefer the default back the other way (fetch gathers all upstream branches), but either way is fine as long as it's configurable.
Thanks!
贡献指南
调研方向
Start by locating the gh repo clone implementation and the code that configures the upstream remote, then read issue 2557 for the rationale behind the current default. Done means users can configure cloning to fetch all upstream branches, either through a flag or another supported option, while preserving the existing behavior when it is not enabled.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, go
- 领域
- cli
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100