2017-01-12 21 views
0

每當我進入我的VPS時,我總是必須通過一系列命令才能讓我的git repo從上游獲取更改。有時候我很幸運,而且很有效。在大多數情況下它給了我找不到錯誤:Git始終無法從服務器上游拉動

ERROR: Repository not found. 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

我已經添加了以下到機器上的.bashrc文件的末尾:

eval "$(ssh-agent)" 
eval "ssh-add /home/deploy/.ssh/id_rsa3" 

當我ssh在我看到的在外殼下面的輸出:

Agent pid 7974 
Identity added: /home/deploy/.ssh/id_rsa3 (/home/deploy/.ssh/id_rsa3) 

id_rsa3公鑰的匹配指紋保存在Github上回購設置部署的關鍵。除非我手動運行上述命令,否則它永遠不會工作。這是爲什麼?

+0

什麼(失敗的)命令是你想運行?是你的*普通* ssh-key(例如'〜/ .ssh/id_rsa')連接到你的github帳戶?您的github賬戶是否有權訪問回購? –

回答

4

硒起來~/.ssh/config配置爲您ssh在非標準的位置,重點工作:

Host git-host-you-are-using-to-pull-from 
    IdentityFile /home/deploy/.ssh/id_rsa3