与Gitlab的本地SSH连接不工作

我希望能够克隆,推和拉(通过SSH)在我自己的Gitlab服务器上。

目前,当试图从我的服务器本地克隆一个git仓库时,我得到这个:

jacob@server: git clone [email protected]:project.git fatal: 'project.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly 

当我尝试通过SSH连接,我得到一个正常的shell:

 jacob@server: ssh [email protected]: git@server:~$ 

localhostreplacegit.example.com,127.0.0.1或本地IP产生相同的结果。

从另一台电脑克隆/ …工作完美无瑕。 当我通过SSH从其他PC连接时,显示:

 jacob@mypc: ssh [email protected]: PTY allocation request failed on channel 0 Welcome to GitLab, jacob! Connection to git.example.com closed. 

看起来在你的SSH shell-gettingtesting中明显的问题是不相关的(服务器可能只是用完了PTY)。 你不应该需要分配一个terminal来使用git。

project.git是位于用户git的主目录中的git仓库。 同时检查当前工作目录中是否没有文件夹project.git