Skip to content

gh pr create fails: none of the git remotes correspond to GH_HOST #32

Description

@dnyw4l3n13

Problem

gh pr create fails when GH_HOST is set to a proxy host but the git remote uses github.com.

Command

gh pr create --draft --title "..." --head feature/145-packages-interfaces-tests --base main --body "..."

Error

none of the git remotes configured for this repository correspond to the GH_HOST environment variable. Try adding a matching remote or unsetting the variable

Context

  • Repository: credfeto/credfeto-dotnet-repo-tools
  • Git remote: git@github.com:credfeto/credfeto-dotnet-repo-tools.git
  • GH_HOST: github-api.markridgwell.com

The gh CLI refuses to create the PR because the git remote uses github.com but GH_HOST is the proxy. Other gh commands (gh issue view, gh issue edit, gh issue comment) work correctly when --repo is specified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions