Skip to content

krew fails to work if defaultRemoteName is assigned in ~/.gitconfig #853

@dustmop

Description

@dustmop

I have this config option set in my global ~/.gitconfig file:

[clone]
	defaultRemoteName = home

Which changes the default remote name to home. However, krew assumes that the default remote name is always going to be origin, due to

return Exec(dir, "config", "--get", "remote.origin.url")

This causes most commands to fail:

> kubectl krew install [PACKAGE_NAME_HERE]
failed to retrieve plugin indexes: failed to list the remote URL for index default: command execution failure, output="": exit status 1

It would be better if one of the following were true:

  1. krew would detect this setting and use the actual remote name
  2. krew did not use this setting from the global config, perhaps by running with a blank config
  3. The error message was better when GetRemoteURL returned empty data

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/supportCategorizes issue or PR as a support question.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions