You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh repo fork does not set the default push remote #3724
> gh --version
gh version 1.10.3 (2021-05-21)
https://github.com/cli/cli/releases/tag/v1.10.3
Steps to reproduce the behavior
Clone any repo. For this test, I cloned this repo with git repo clone cli/cli.
Run gh repo fork --remote=true --clone=true (or git repo fork and select the equivalent of those arguments when prompted)
Commit some changes and run git push.
See error:
ERROR: Permission to cli/cli.git denied to $USER.
fatal: Could not read from remote repository
Expected vs actual behavior
When forking a repo, gh should set the default remote to the fork, at least in my opinion.
Obviously, you can just run git push -u origin trunk yourself, replacing trunk with the current branch, or just run git push -u origin --all; however, I think it would make sense for gh repo fork to preform this automatically or at least provide the option to do so.
Thanks for the suggestion! The workflow you suggested makes sense.
gh repo fork was never designed to automatically set push configuration for you, so I don't see this as a bug, but as an additional enhancement we can consider. I will reassign labels accordingly.
I like the idea of asking the user if they want us to run git push -u origin --all for them and a corresponding flag like... --reset-upstream or something?
Activity
mislav commentedon May 27, 2021
Thanks for the suggestion! The workflow you suggested makes sense.
gh repo forkwas never designed to automatically set push configuration for you, so I don't see this as a bug, but as an additional enhancement we can consider. I will reassign labels accordingly.vilmibm commentedon Jun 1, 2021
I like the idea of asking the user if they want us to run
git push -u origin --allfor them and a corresponding flag like...--reset-upstreamor something?