您的位置:首页 > 理论基础 > 计算机网络

git SSH公钥和https请求

2016-10-17 19:16 169 查看
ssh方法:1.Mac/Linux 打开命令行终端, Windows 打开 Git Bash 。 输入ssh-keygen -t rsa -C “username@example.com”,( 注册的邮箱),接下来点击enter键即可(也可以输入密码)。

2.本地打开 id_rsa.pub 文件(或执行 $cat id_rsa.pub ),复制其中全部内容,添加到账户“SSH
公钥”页面 中,公钥名称可以随意起名字。完成后点击“添加”,然后输入密码或动态码即可添加完成。

3.ssh -T git@git.coding.net

https方法:对于
Https 协议: 首先在全局配置保存你的密码, ~/.git-credentials (没有就创建)内添加 https://{username}:{passwd}@git.coding.net 然后执行配置 Git 命令存储认证命令: 
$git
config --global credential.helper store,
执行后在 ~/.gitconfig 文件会多出下面配置项: 
credential.helper
= store
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  coding