我已經安裝了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