如何在github上发布一个开源项目
2013-11-05 16:56
976 查看
参考网址:https://help.github.com/
1、在github上注册一个帐户,并登录
2、安装和配置git
sudo apt-get install git-core
git config --global user.name "Your Name Here"
git config --global user.email "your_email@example.com" //这里的email地址应该与你登录github的email账户地址保持一致
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=3600'
3、Generating SSH Keys (https://help.github.com/articles/generating-ssh-keys)
ssh-keygen -t rsa -C "your_email@example.com" //这里的email地址应该与你登录github的email账户地址保持一致
ssh-add ~/.ssh/id_rsa
成功的话会在~/下生成.ssh文件夹,进去,打开id_rsa.pub,复制里面的 key。
回到github,进入Account Settings,左边选择SSH Keys,Add SSH Key,title随便填,粘贴key
验证是否成功:
ssh -T git@github.com
4、在github上创建一个新的repository
5、初始化本地Repository
mkdir ~/YourRepositoryName
cd ~/YourRepositoryName
git init
touch README
git add README
git commit -m 'first commit'
6、将本地Repository连接到远程github上对应的Repository
git remote add origin https://github.com/yourName/YourRepositoryName.git
git push origin master
若出现:
error: The requested URL returned error: 403 while accessing https://github.com/yourName/YourRepositoryName.git/info/refs
fatal: HTTP request failed
git remote set-url origin ssh://git@github.com/yourName/YourRepositoryName.git
git push origin master
1、在github上注册一个帐户,并登录
2、安装和配置git
sudo apt-get install git-core
git config --global user.name "Your Name Here"
git config --global user.email "your_email@example.com" //这里的email地址应该与你登录github的email账户地址保持一致
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=3600'
3、Generating SSH Keys (https://help.github.com/articles/generating-ssh-keys)
ssh-keygen -t rsa -C "your_email@example.com" //这里的email地址应该与你登录github的email账户地址保持一致
ssh-add ~/.ssh/id_rsa
成功的话会在~/下生成.ssh文件夹,进去,打开id_rsa.pub,复制里面的 key。
回到github,进入Account Settings,左边选择SSH Keys,Add SSH Key,title随便填,粘贴key
验证是否成功:
ssh -T git@github.com
4、在github上创建一个新的repository
5、初始化本地Repository
mkdir ~/YourRepositoryName
cd ~/YourRepositoryName
git init
touch README
git add README
git commit -m 'first commit'
6、将本地Repository连接到远程github上对应的Repository
git remote add origin https://github.com/yourName/YourRepositoryName.git
git push origin master
若出现:
error: The requested URL returned error: 403 while accessing https://github.com/yourName/YourRepositoryName.git/info/refs
fatal: HTTP request failed
git remote set-url origin ssh://git@github.com/yourName/YourRepositoryName.git
git push origin master
相关文章推荐
- 查看github pages文档的方式
- 使用BAE的基于Web.py的简单博客程序
- 利用AJAX开源项目 在网页里播放视频实现方法
- C语言实现的轻量级brainfuck语言解释器
- 如何做一个真正牛X 的开源项目
- 我用过的几个开源GIS软件
- git+github创建分支&提交并贡献代码(linux环境)
- github+firebase建站
- linux下git与github简单使用
- Ubuntu9.10安装Git,Git 和Github初次使用
- 英雄所见略同
- BBCloneMail-on-Meteor
- 如何做一个牛X的开源项目
- 使用github page建立免费的静态网站和博客网站
- 版本控制器git与vs2010安装
- Android企业级开源项目
- 如何在UBUNTU下使用github
- Android 优秀开源项目
- eoe社区 Android 客户端项目简析