Skip to content

gh pr create fork helper behavior differs from gh repo fork #4627

@matschaffer

Description

@matschaffer

Describe the feature or problem you’d like to solve

Today I ran gh pr create on a repo I hadn't yet forked and decided to use the "create fork" option.

I was surprised to find that this added my fork as fork and left the upstream as origin.

❯ git remote                     
fork
origin

After using gh repo fork for so long I would have expected it to switch origin to upstream and place my fork as origin.

Proposed solution

Modify the gh pr create fork helper to use the same behavior as gh repo fork and offer the option to move your personal fork to origin.

Additional context

I was able to work around this by running this after creating my PR:

git remote rm fork
gh repo fork

So it's not a big issue, but the behavior definitely surprised me.

Metadata

Metadata

Assignees

Labels

enhancementa request to improve CLIhelp wantedContributions welcome

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions