我正在尝试使用Cygwin的git,但这就是我所看到的:
$ git clone ssh://git-repo/some/repository
Cloning into 'repository'...
ssh: git-repo-actual-host-name.com: no address associated with name
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
该消息显然是错误的,因为:
$ echo "$HOME"
/home/wvxvw
$ cat $HOME/.ssh/config
Host git-repo
HostName git-repo-actual-host-name.com
User wvxvw
IdentityFile ~/.ssh/id_rsa
$ ls $HOME/.ssh
config id_rsa id_rsa.pub known_hosts
任何想法出了什么问题/如何帮助它?
修改:
相同的信息,但较少“混淆”:
~/.ssh/config
Host tlv-git
HostName tlv-git.host.com
User WINDOMAIN\\wvxvw
IdentityFile ~/.ssh/id_rsa
$ ssh tlv-git
ssh: Could not resolve hostname tlv-git: hostname nor servname provided, or not known
$ ssh tlv-git.host.com
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).
如果我尝试克隆一些存储库,会发生这种情况:
$ git clone ssh://tlv-git/repo
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).
但是我安装了ssh-agent
,所以如果我这样做:
$ eval $( ssh-agent )
$ ssh-add
$ git clone ssh://tlv-git/repo
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).
但是,如果我提供用户名,那么它可以工作......
$ git clone ssh://WINDOMAIN\\wvxvw@tlv-git/repo
答案 0 :(得分:0)
URL应该为git-repo:/some/repository
,〜/ .ssh / config用户通常是专门用于安装gitosis的用户(git
,而不是wvxvw
)
这几天(2018年,5年后),如果需要重复相同的设置,它将使用: