Skip to content

failed to resolve address with custom ssh hostname for github #152

Description

@jmelahman

It's common to use multiple ssh keys for authenticating with various projects. With a non-default hostname for github.com, git metrics fails with,

$ git metrics -v pull
2025-02-06T21:54:48.350455Z ERROR git_metrics::backend::git2: unable to pull metrics: Error { code: -1, klass: 12, message: "failed to resolve address for github.com-applied: Name or service not known" }
unable to pull metrics


	failed to resolve address for github.com-applied: Name or service not known; class=Net (12)

Minimal ~/.ssh/config

Host github.com-example
    Hostname github.com

Repro steps:

git remote set-url origin git@github.com-example:jdrouet/git-metrics.git
git pull origin main  # works
git metrics pull  # fails

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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