每当我想在我的存储库中提交某些内容时,我都必须输入
ssh-add ~/.ssh/my_git_key_file
有没有办法让我每次想要提交某事时都不再这样做? 我想使用包含此内容的 .netrc 文件而不是 ssh key :
machine github.com
login <login_github>
password <password_github>
最佳答案
发生这种情况是因为您的 SSH 守护程序未运行。您可以通过运行来修复该问题:
eval `ssh-agent -s`
ssh-add ~/.ssh/my_git_key_file
那么它就不会再询问您有关 SSH 密码的问题。
如果您想使用 .netrc
文件,请使用 HTTPS 存储库 URL:
git remote set-url origin https://github.com/owner/repo.git
关于git - github 上的 ssh key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33237347/