我已经安装了GitLab。假设我将它安装在/home/myuser/gitlab
。推送Gitlab回购时ssh连接失败
- 我创建了一个新的项目
- 有人告诉我,创造一个回购“测试”我把
/home/myuser/gitlab/test
- 我加了一些SSH密钥在
/home/myuser/.ssh
- 然后我
/home/myuser/gitlab/test
初始化一个Git回购。 - 以下说明中,我添加了一个远程
[email protected]:root/testing.git
但是当我尝试推,我收到此错误信息:
$ git push -u origin master
ssh: connect to host localhost port 22: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我在OS X安装GitLab和我有其他的SSH密钥在/home/myhome/.ssh
,我已在/home/myuser/gitlab/.git/config
内设置了用户电子邮件和名称(并将其设置为全局测试),并从/home/myuser/gitlab
启动服务器。有谁知道这个错误来自哪里?
如果我跑ssh [email protected]
,我得到
/home/myhome/.ssh/config line 4: garbage at end of line; "home".
凡在这个文件我有另一个项目的远程服务器的一些设置。我认为这是问题,但我不知道如何解决这个问题。
更新:这是我的~/.git/config
文件的内容
Host remote_test_server
Hostname [email protected]_test_server
IdentityFile ~/.ssh/id_rsa_stf.pub
User <your home acct>
@AloisMahdal是的,我认为这是一个烫发问题。我将在运行'ssh -T git @ localhost'时更新我的标题 – Newben