mynote/git/ssh_key.md
2018-01-24 01:10:43 +08:00

19 lines
553 B
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ssh key 生成和使用
## 生成 ssh key
git config --global user.name 'light'
git config --global user.email '1870499383@qq.com'
ssh-keygen -t rsa -C '1870499383@qq.com'
注:连按三下回车,选择默认即可
## key 地址
/.ssh/id_rsa.pub
## 上传key至git服务器如githubgitlab
在个人设置界面如gitlab都有如下类似界面
![ssh key](/static/img/ssh_key.png)
在 key中添加 id_rsa.pub文件中的字符串点击保存即可
则该git服务器上的项目都可在本机上通过ssh地址直接pullpush