Git是分布式的代碼管理工具老厌,遠程的代碼管理是基于SSH的边翼,所以要使用遠程的Git則需要SSH的配置腮敌。
github的SSH配置如下:
一 征懈、
設置Git的user name和email:
$?git?config?--globaluser.name“wanghanqing"
$?git?config?--global?user.email"wanghanqing@shopex.cn"
二石咬、生成SSH密鑰過程:
1.查看是否已經(jīng)有了ssh密鑰:cd ~/.ssh
如果沒有密鑰則不會有id_rsa和id_rsa.pub,有則備份刪除
2.生存密鑰:
$ ssh-keygen -t rsa -C “wanghanqing@shopex.cn”
按3個回車卖哎,密碼為空鬼悠。
Your identification has been saved in /home/tekkub/.ssh/id_rsa.
Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.
The key fingerprint is:
………………
最后得到了兩個文件:id_rsa和id_rsa.pub
三. git.shopex.cn —>profile—>SSH—>AddSSH (復制id_rsa.pub文件的內(nèi)容)