git-plus icon indicating copy to clipboard operation
git-plus copied to clipboard

Host aliases in ~/.git/config do not work

Open gulench opened this issue 9 years ago • 3 comments

Attempting to pull a repository URL (e.g. git@gitlab-alias:group/project.git) that uses Host alias from ~/.ssh/config fails with the following error:

ssh: Could not resolve hostname gitlab-alias: no address associated with name
fatal: Could not read from repository.

Contents of ~/.ssh/config:

Host gitlab-alias
  HostName gitlab.com
  User git
  IdentityFile /c/Users/me/.ssh/gitlab_id_rsa

gulench avatar Feb 15 '16 21:02 gulench

I'm trying to use a separate pair of rsa keys which I specified in .ssh/config. git-plus does always take the default keys.

Is there a way to configure which keys to use?

dampfhamm3r avatar Nov 01 '16 13:11 dampfhamm3r

This package doesn't touch or choose anything related to your ssh configurations. All the commands are executed in a spawned child processes so those configurations should translate.

I'm able to use host aliases in and everything still works. @gulench When you try to pull from the command line does it work?

@dampfhamm3r No there isn't a way because the package doesn't do anything with those settings.

akonwi avatar Nov 09 '16 20:11 akonwi

@akonwi I have the same situation as @gulench, my config file is

Host github.com
	IdentityFile /c/Users/aroc/.ssh/github

Making a pull or a push doesn't work, using Git Bash under windows works. (My ssh key has passphrase).

AmauryOrtega avatar Apr 30 '17 17:04 AmauryOrtega