0

我在同一网络上设置了 linux 服务器,当我尝试将 repo 添加到我的计算机时,我收到以下错误消息:

ssh: Could not resolve hostname 192.168.1.128:: nodename nor servname provided, or not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我在 mac 上使用 git tower,存储库 url 如下所示:

ssh://linux@192.168.1.128:/var/www/gitrepo/cm_main.git

更新:(删除 ssh:// 后我收到的错误消息

Pushing to linux@192.168.1.128:/var/www/gitrepo/cm_main.git
Counting objects: 965, done.
Delta compression using up to 2 threads.
Compressing objects:   0% (1/946)   
Compressing objects:   1% (10/946)   
...
Compressing objects:  99% (937/946)   
Compressing objects: 100% (946/946)   
Compressing objects: 100% (946/946), done.
Writing objects:   0% (1/965)   
Writing objects:   1% (10/965)   
Writing objects:   2% (20/965)   
Writing objects:   3% (29/965)   
fatal: Unable to create temporary file '/var/www/gitrepo/cm_main.git/.git/./objects/pack/tmp_pack_XXXXXX': Permission denied
error: pack-objects died of signal 13
error: failed to push some refs to 'linux@192.168.1.128:/var/www/gitrepo/cm_main.git'
4

2 回答 2

0

尝试删除 ssh:// 前缀。

于 2013-01-03T23:05:58.897 回答
0

如果你使用ssh://语法,你需要 make it ssh://user@host/path/to/repo。您版本中的冒号是错误的。

否则,如果您没有使用显式协议,则它是user@host:/path/to/repo,因此您的第二个版本应该可以工作。您收到的错误消息表明存在完全不同的问题:

fatal: Unable to create temporary file '/var/www/gitrepo/cm_main.git/.git/./objects/pack/tmp_pack_XXXXXX': Permission denied

因此,您尝试使用 ( linux) 推送的用户在远程存储库文件夹中没有写入访问权限。

于 2013-01-03T23:16:18.997 回答