github for linux (centos)
1,登陆https://github.com/注册账号
2,安装
# su root
#yum insatll git git-ui
把本地仓库传到github,需要配置ssh key
3,配置github
创建本地ssh key
#ssh-keygen -t rsa -C "你的邮箱"
#ls -a 列出隐藏文件
这时候会创建id_rsa id_rsa.pub两个文件
回到https://github.com/进入Accout Settings, 左边的列表中 选择ssh keys, add ssk key ,
然后 任意输入title, 将id_rsa.pub文件中的key ,粘贴到编辑框中。
4,测试能否连接
进入linux ,
#ssh -T git@github.com
You've successfully ,呵呵,就成功了。
遇到的问题,重新安装git git-ui
#yum reinstall git git-ui 重复上述过程问题解决了 .........
5,将本地仓库上传到github,要先设置username ,email(github将记录所有的commit)
6,设置git信息
7,创建一个新的项目
8, github端设置
# git remote add origin 复制的地址 (https://github.com/xxxxx/xxxxx.git)
#git push -u origin master
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/xxxxx/xxxxx.git/info/refs
fatal: HTTP request failed
解决办法:
#vim .git/config
url = https://github.com/yourname/example.git 修改成 url = https://yourname@github.com/yourname/example.git
就OK了
不错的博客:
http://www.cnblogs.com/purediy/archive/2013/03/07/2948892.html
http://blog.youkuaiyun.com/showhilllee/article/details/27706679
http://blog.itpub.net/25851087/viewspace-1262468/
转自:http://blog.youkuaiyun.com/meiyoudao_jiushidao/article/details/44134819
不错的博客:
http://www.cnblogs.com/purediy/archive/2013/03/07/2948892.html
http://blog.youkuaiyun.com/showhilllee/article/details/27706679
http://blog.itpub.net/25851087/viewspace-1262468/