2017-01-12 19 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