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
If one has a fork of a repository (but also have write access to the main repository), then gh pr create -f will add the personal fork as a fork remote, and try to push a branch there. That will ask for a username/password. But if fixed, it would also create a branch in the wrong repository.
gh version 0.10.1 (2020-06-24)
Steps to reproduce the behavior
Clone a repository in an organization that you have write access to
Ensure you have a personal fork of that repository
Clone the original repository, and do not add your fork as a remote
Check git remote -v at this point
Make some change on a branch, and do gh pr create -f
Check git remote -v at this point too
Expected vs actual behavior
At step 5, a remote named fork will be added and you may be prompted for credentials if you use SSH keys, which I do.
I do not want a remote to be added, I want to push a branch to the repository I have cloned, since I have write access to it.
The fork remote was added using https, whereas it should have ideally followed the same protocol as the origin remote and used the SSH protocol. We are tracking this in gh repo fork adds remote using https protocol even if repository was cloned through ssh #1056, but for now you can configure your gh installation to always default to SSH URLs: gh config set git_protocol ssh
Describe the bug
If one has a fork of a repository (but also have write access to the main repository), then
gh pr create -f
will add the personal fork as afork
remote, and try to push a branch there. That will ask for a username/password. But if fixed, it would also create a branch in the wrong repository.gh version 0.10.1 (2020-06-24)
Steps to reproduce the behavior
git remote -v
at this pointgh pr create -f
git remote -v
at this point tooExpected vs actual behavior
At step 5, a remote named
fork
will be added and you may be prompted for credentials if you use SSH keys, which I do.I do not want a remote to be added, I want to push a branch to the repository I have cloned, since I have write access to it.
Logs
The concrete example for me was https://github.com/whatwg/fullscreen which I have a fork of.
At step 4:
At step 5:
gh pr create -f
gets stuck with a prompt:At step 6:
Workaround
Delete your fork.
The text was updated successfully, but these errors were encountered: