ssh:无法解析主机名用户名:没有与name,git相关联的地址

时间:2016-06-29 15:48:25

标签: git ssh

在我的共享主机目录中,我在git目录中有一个烧瓶应用程序:

username@so6 [~/domains/mi]# ls -la
total 88
drwxr-xr-x  7 username username 4096 Jun 28 12:30 ./
drwxr-xr-x 19 username username 4096 Jun 28 12:30 ../
-rw-rw-r--  1 username username   59 Jun 28 12:30 .bowerrc
drwxrwxr-x  5 username username 4096 Jun 28 12:30 .git/
-rw-rw-r--  1 username username  400 Jun 28 12:30 .gitignore
drwxrwxr-x  3 username username 4096 Jun 28 12:30 .idea/
-rw-rw-r--  1 username username 8192 Jun 28 12:30 dev.db
-rw-rw-r--  1 username username 2528 Jun 28 12:30 manage.py
drwxrwxr-x  3 username username 4096 Jun 28 12:30 migrations/
drwxrwxr-x  8 username username 4096 Jun 28 12:30 myflaskapp/

我想将其与本地副本合并,所以我尝试了:

$ git remote add shared ssh://username:password@mydomain.net/home/username/domains/mi.git
~/mi (master)
$ git pull shared master
ssh: Could not resolve hostname username: 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.

我做错了什么?

1 个答案:

答案 0 :(得分:3)

这不是git uri的样子:

ssh://username:password@mydomain.net/home/username/domains/mi.git

您无法将ssh个密码放入uri。主机名和路径之间的分隔符也是:而不是/。它应该只是

ssh://username@mydomain.net:/home/username/domains/mi.git