cli / cli/cli

Allow `gh repo clone` to grab all upstream branches

Open
#3,312 7 comments 8 reactions 0 assignees View on GitHub
core enhancement gh-repo
Dominant language
Go
Stars
46.3k
Forks
9k
Avg merge
2d 9h
Merged PRs (30d)
89

Description

### 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!

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.