ubuntu14.04下github的安装与使用
2015-05-18 14:04
225 查看
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
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
相关文章推荐
- Github 在 Ubuntu Server 10.10 下的安装和使用
- Ubuntu14.04下使用grub引导硬盘安装Windows7系统、Windows8系统
- 在ubuntu下怎么安装和使用Github
- ubuntu14.04下使用pypombs安装gnuradio
- Ubuntu 12.04 下 GitHub安装和使用快速入门
- Ubuntu 12.04 下 GitHub安装和使用快速入门
- 解决Ubuntu 14.04下Sublime Text使用Package Control安装插件失败
- Ubuntu14.04下Opencv2.4.9的安装及配置使用
- ubuntu上github的安装与使用
- Ubuntu14.04下Git安装和使用快速入门
- ubuntu14.04环境中github的安装与使用入门教程(最新,2016-06-03)
- 在ubuntu下怎么安装和使用Github
- Ubuntu14.04下tftp的安装,并使用tftp将文件传输到开发板上面执行
- ubuntu下使用github安装R Packages[已解决]
- ubuntu14.04下vnc安装、配置和使用
- Ubuntu14.04下使用PPA安装php5.6,php7
- Ubuntu下安装git及配置使用github
- Ubuntu下Git的安装和使用,linux下更新GitHub源码
- Git使用:Linux(Ubuntu 14.04 x64)下安装Git并配置连接GitHub
- ubuntu16.04下github的安装和使用