Skip to content

add flag to pr checkout to use detached head #902

@openjck

Description

@openjck

Describe the feature or problem you’d like to solve

The CLI clutters my local repo with branches from past invocations of gh pr.

For example, imagine working on a project with a pull request #123 which corresponds to a branch named add-some-feature. Running gh pr checkout 123 will add a branch named add-some-feature to the local repo. When the branch is changed to something else (say, master), the add-some-feature branch will remain.

These can add up over time.

Proposed solution

I would like if gh pr checked out the changes in a detached HEAD state. That way, when the branch is changed to something else (again, say, master) no branch would be left behind.

Metadata

Metadata

Assignees

No one assigned

    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