切换Git以使用SSH [英] Switching Git to use SSH

查看:39
本文介绍了切换Git以使用SSH的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已设置SSH密钥并将其添加到Git服务器.即使那样,从我的命令行使用Git时,它仍然使用用户名和密码进行身份验证.是否有任何命令可以更改我的身份验证机制.

I have an SSH key set up and added to Git servers. Even then, while using Git from my command line, it still uses username and password for authentication. Is there are any command to change my authentication mechanism.

推荐答案

您是否使用git协议设置了远程分支URL?

Did you set your remote branch URL using git protocol?

您可以设置

git remote set-url origin [SSH协议URL]

git remote set-url origin [SSH protocol URL]

SSH协议URL看起来像git@github.com:torvalds/linux.git

SSH protocol URL looks like git@github.com:torvalds/linux.git

这篇关于切换Git以使用SSH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆