lijiankou的个人博客分享 http://blog.sciencenet.cn/u/lijiankou

博文

从GitHub创建库

已有 3142 次阅读 2013-8-22 20:24 |个人分类:版本控制|系统分类:科研笔记

一、创建ssh key

通过SSH key绑定本地主机和GitHub,首先在本地产生一个SSH Key,并将key加入到GitHub帐户的公共Key中。

创建key命令如下:

ssh-keygen -t rsa -C "email" , 出现提示一路回车就可以了。

二、将Key 添加到GitHub

首先安装xclip,sudo apt-get install xclip

然后复制id_rsa.pub的内容

xclip - sel clip < /home/user_name/.ssh/id_rsa.pub

然后到GitHub页面,找到 Account Settings,点击左边的“SSH Keys”,点击“Add SSH Key”, 把“Key”粘贴到“Key”里面,点击“Add Key”

三、测试

ssh -T git@github.com

如显示:

Hi ...! You've successfully authenticated, but GitHub does not provide shell access. 则表示安装成功

四、创建一个GitHub中的库

使用clone命令

如下: git clone git@github.com:lijiankou/prml.git   , 之后就可以使用了。

如果是第一次push,会出现如下情况:

”No refs in common and none specified; doing nothing.  
Perhaps you should specify a branch such as 'master'.  
fatal: The remote end hung up unexpectedly  
error: failed to push some refs to 'file:///xxxxxxx.git'  

使用下面命令即可:

git push origin master


相关资料:

http://wuyuans.com/2012/05/github-simple-tutorial/

https://help.github.com/articles/generating-ssh-keys

http://blog.csdn.net/feiniao1221/article/details/7516421

http://alexliyu.blog.163.com/blog/static/16275449620128675655428/




https://blog.sciencenet.cn/blog-520608-718966.html

上一篇:高斯过程
下一篇:伽玛分布
收藏 IP: 124.16.137.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-29 11:34

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部