-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Description
Describe the bug
When create a new PR via gh pr create from a branch that hasn't been pushed, gh ignores the base repository, considering only forks even if the submitter can push to the main repository.
This can create unexpected situations if the submitter doesn't have a personal fork. For example, if some other contributor has a personal fork and they gave you write access, gh pr create will push a new branch to their repo and then create a PR to the base.
I believe that selecting the base repository when the submitter can push to it is a better default, or at least a less surprising one.
Version: gh version 0.6.4-100-g82bd7b9 (2020-04-17) (compiled from master today)
Steps to reproduce the behavior
- Create a repository
- Ask someone else to fork it and give you write access to their fork
- Create a new local branch, commit some code but don't push it
- Run
gh pr create - Check the repository where the branch was created
Expected vs actual behavior
I'd expect gh pr create to create a branch in the main repository if the submitter has write access to it instead of choosing someone else's fork.