Skip to content

gh repo create to work on bare repos #9904

@hahnandrew

Description

@hahnandrew

Describe the feature or problem you’d like to solve

When I use gh repo create and specify "Push an existing local repository to Github" on my bare repository, it says "current directory is not a git repository. Run git init to initialize it". To resolve this, I go to the web interface and manually create a new repo. I'd like to request for gh repo create to recognize bare repositories as repositories.

Proposed solution

#6880 was a merged PR that migrated to git rev-parse's --git-dir flag to correctly recognize bare and non-bare repos for another part of the github cli for a similar issue. Although this is what the gh repo create command also does, it only checks if the result is .git, instead of also checking if it's also . in the case of a bare repo. We can check for a . case.

Additional context

This will make the CLI's functionality more streamlined and consistent with user expectations

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIgh-reporelating to the gh repo command

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions