Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法添加远程(同一网络上的本地)git repo_Git - Fatal编程技术网

无法添加远程(同一网络上的本地)git repo

无法添加远程(同一网络上的本地)git repo,git,Git,我在同一网络上安装了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 r

我在同一网络上安装了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'

尝试删除ssh://前缀。

如果使用
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
)在远程存储库文件夹中没有写访问权限。

我这样做了,但出现了另一个错误。请在上面的“更新”下查看错误消息。不要紧,谢谢!我成功了,我只需对目录进行chmod即可。太好了,我很高兴您找到了:-)!