我在同一网络上安装了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'
答案 0 :(得分:0)
尝试删除ssh://前缀。
答案 1 :(得分:0)
如果您使用ssh://
语法,则需要将其设为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
)在远程存储库文件夹中没有写访问权限。