-
Notifications
You must be signed in to change notification settings - Fork 7k
Description
Describe the feature or problem you’d like to solve
Currently, if I run gh repo clone my_repo, wheren my_repo is a fork under my github account of another repository, I get two remotes set up, an upstream and an origin, with the default branch (typically main) having its upstream set to origin/main.
For my typical workflow, it would be preferable to have the upstream of the main branch be upstream/main (or whatever name is passed with -u, since what I typically will do is:
- Checkout the main branch
- Pull changes from upstream
- Make a new feature branch
- Push to my fork.
So currently, after a gh repo clone my_repo, I always run git branch --set-upstream-to upstream/main. I'd prefer if this could be done in the original clone command.
Proposed solution
An additional optional boolean flag to gh repo clone, that will set the upstream of the main branch to the upstream remote, if set (if cloning a repo that is a fork in the user's namespace).
If the flag is set, I'd like for the original clone to be made from the upstream remote, rather than from my fork.