ubuntu14.04下github的安装与使用
来源:互联网 发布:php网站流量统计代码 编辑:程序博客网 时间:2024/06/05 21:59
1、申请一个github的账户(申请网址为:http://github.com)
2、安装git
$sudo apt-get install git
3、生成密钥对,这样项目可以push到github上
$ssh-keygen -t rsa -C "邮箱"
4、将.ssh/id_rsa.pub复制到github网站上去
Generating public/private rsa key pair.
Enter file in which to save the key (/home/zcq/.ssh/id_rsa): #一般直接回车,使用默认的路径。其中.ssh/id_rsa是隐藏文件
Enter passphrase (empty for no passphrase): #输入密码
Enter same passphrase again:
Your identification has been saved in /home/zcq/.ssh/id_rsa.Your public key has been saved in /home/zcq/.ssh/id_rsa.pub.
The key fingerprint is:
.................
.................
$cat /home/zcq/.ssh/id_rsa.pub #找到公钥,并将其复制到github网站的SSH keys中去(settings-->SSH keys)
#Title名字任取,key为刚才复制的公钥
5、为了方便,设置ssh不输入口令
$eval `ssh-agent`
$ssh-add
Enter passphrase for /home/zcq/.ssh/id_rsa: #输入密码
6、测试是否可以联通到github
$ssh git@github.com
如果配置正确,则会显示
Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
7、设置git全局用户配置
$git config --global user.name "xxx"
$git cofig --global user.email 邮箱
8、使用github
(1)新建一个仓库(repository)
填写好仓库名称(比如first_project),简单写一些描述,并勾选上初始化仓库README
(2)克隆版本库
$git clone git@github.com:xxx/first_project.git #在根目录下
$ cd first_project
$ touch index.html
$ echo "this is git test" > index.html
$ git add index.html
$ git commit -m "add index.html"
$ git push origin master
(3)在github仓库中就可以看到刚刚加入的index.html
- ubuntu14.04下github的安装与使用
- ubuntu14.04环境中github的安装与使用入门教程(最新,2016-06-03)
- Ubuntu14.04下MySQL的安装与卸载
- Ubuntu14.04下MySQL的安装与卸载
- Ubuntu14.04下Vim的安装与配置
- Android Studio在Ubuntu14.04下的安装与测试
- Ubuntu14.04下MySQL的安装与卸载
- Ubuntu14.04下maven3.3.9的安装与测试
- Linux(Ubuntu14.04)下HelixServer的安装与配置
- Ubuntu14.04下ROS的安装与配置
- Ubuntu14.04下Vim的安装与配置
- Ubuntu14.04下Opencv2.4.9的安装及配置使用
- cgdb---ubuntu14.04下安装cgdb及gdb的使用
- Ubuntu环境下GitHub安装与使用
- ubuntu14.04下使用pypombs安装gnuradio
- ubuntu14.04下libvmi 编译安装使用
- Ubuntu14.04下kpatch源码安装使用
- Ubuntu14.04下安装以及使用Git
- 截取字符串的部分字符方法
- 第九周 项目4-我的向量类
- Linux shell 文本处理工具
- DLog打印出打印的数据在什么方法内打印的
- 图像处理中的跨度(stride)
- ubuntu14.04下github的安装与使用
- ld:file not found: /Users/hx/Library/Developer/Xcode/DerivedDat
- 基于源码开机蓝牙一直扫描并自动连接指定的蓝牙设备
- Android开机流程分析 -- Zygote
- Android中View大小的确定过程
- data time
- .net中 母版页、子页、及子页中的用户控件三者的加载顺序
- Hive 查询优化总结
- Android Studio使用心得 - 常见问题集锦