Allow `gh repo clone` to grab all upstream branches
- Ngôn ngữ chính
- Go
- Star
- 46.3k
- Fork
- 9k
- Merge trung bình
- 2 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 97
Mô tả
### 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!
Hướng dẫn đóng góp
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- git, go
- Lĩnh vực
- cli
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 25/100