-
设置Git的user name和email:
$ git config --global user.name "xxx"
$ git config --global user.email "xxxx@gmail.com"
<span style="font-size: 14px; line-height: 26px; color: rgb(34, 34, 34); font-family: Helvetica, Arial, sans-serif;">查看是否已经有了ssh密钥:cd ~/.ssh</span><br style="font-size: 14px; line-height: 26px; color: rgb(34, 34, 34); font-family: Helvetica, Arial, sans-serif;" /><span style="font-size: 14px; line-height: 26px; color: rgb(34, 34, 34); font-family: Helvetica, Arial, sans-serif;">如果没有密钥则不会有此文件夹,有则备份删除</span>
<span style="font-size: 14px; line-height: 26px; color: rgb(34, 34, 34); font-family: Helvetica, Arial, sans-serif;"></span><p class="p1"><span class="s1"># </span>生成私钥<span class="s1">&</span>公钥</p><p class="p2">$ ssh-keygen -t rsa -C <span class="s2">"97606813@qq.com"</span></p>
-
# 查看公钥内容
$ cat oschina_rsa.pub
# 选中输出的内容 cmd+c,到 oschina 上添加公钥 cmd + v
-
# 开启agent程序
$ eval "$(ssh-agent -s)"
-
#注意, 添加的是私钥, 不是pub
$ ssh-add ~/.ssh/oschina_rsa
# 验证账号
$ ssh -T git@git.oschina.net
-
提示:只要看到以下内容,今后就再也不用管密码了!
Welcome to Git@OSC
-
开始使用github
1.获取源码:$ git clone git@github.com:billyanyteen/github-services.git