我使用命令行添加了一个远程裸仓库:
git add remote production ssh://username@domain.com/path/to/repo.git
我可以使用以下方式推送到存储库:
git push production master
现在我想从 SmartGit 推送:
- 我右键单击本地主分支并选择推送到...。
- 在窗口中,我选择生产存储库并单击推送。
- 出现一个对话框,要求我提供 SSH 私钥和密码。我指向私钥并输入密码,然后点击登录。
- 对话框再次显示,我再次点击登录。
SmartGit 在输出窗口中显示错误:
Push: Could not read from remote repository. /var/www/website> git push --porcelain --progress --recurse-submodules-check production refs/heads/master Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Could not read from remote repository.
我已检查我是否拥有正确的访问权限并且存储库存在。此外,私钥仅对 onwer (chmod 600 ~/.ssh/id_rsa
) 具有读/写权限。
我错过了什么?
最佳答案
- 在首选项的身份验证 部分启用使用系统SSH客户端
- 安装 ssh-askpass:
sudo apt-get install ssh-askpass
- 然后再推...
关于git - 对裸存储库的 SmartGit 身份验证失败,而从命令行推送有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37236471/