Skip to content

Allow creating PRs without forking the repository #1486

@msfjarvis

Description

@msfjarvis

Describe the feature or problem you’d like to solve

At my job we rely on private GitHub repositories to house our code and each change goes in through a pull request. Unfortunately, when I run gh pr create, the CLI will by default always attempt to fork the repository, push to it, and then create a pull request. This particular operation fails with cannot fork private repository, which seems to be expected behavior.

Proposed solution

Add a flag to gh pr create, maybe called --no-fork (?) that would instead push to the current 'origin' remote and create a PR off it.

Additional context

So far I've been working around this with an alias that runs git push origin --set-upstream $(git rev-parse --abbrev-ref HEAD) before gh pr create which seems to 'work' but if there's a possiblity to teach gh to not fork it'd be really awesome :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions