1.申请GitHub帐户, 并创建一个新的Repository,名为test
2.安装Git客户端(Linux)
sudo apt-get install git
3.生成密钥对,这样项目可以push到 GitHub上
#ssh-keygen -t rsa -C "xxx@gmail.com"
4.将.ssh/id_rsa.pub文件内容拷贝到GitHub账户AccountSettings-->SSH Keys
-->Add SSH Key
5.测试是否可用
#ssh -T git@github.com
6.设置Git全局用户配置
# git config --global user.name "xxx"
# git config --global user.email "xxx@gmail.com"
7.在本地目录(自己放置项目的地方)
# mkdir test
# cd test
# git init
# touch README.md //此处新建一个文件
# git add README
# git commit -m 'first commit'
定义远程服务器别名origin(可以叫别的),xxx为github账户用户名
# git remote add origin git@github.com:xxx/test.git
本地和远程合并,本地默认分支为master
# git push origin master
8.更新文件
提交更改至本地库
#git commit -a
同步至远程库
# git push origin master
分享到:
相关推荐
github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程github使用教程...
适用于Ubuntu的Github desktop安装文件,deb安装。先运行如下:apt install gconf2 libappindicator1 gconf-service...适用于Linux的GitHub desktop各类安装包下载地址:https://github.com/shiftkey/desktop/releases
github使用github使用github使用github使用github使用github使用github使用
github的使用方法:本文档简介地介绍了github的使用。
github 使用指南 官方中文
GitHub安装包,不需要写命令,很好用的,大家可以下载一下试试
使用repo管理github项目例子
github的详细使用及其相关介绍 包括探索github 加入github 项目托管 工作协同 付费服务等
GitHub入门与实践.pdf
可以对github进行简单的入门,学习github的使用
临时允许朋友使用Github的公钥ssh登录到你的Linux
Github使用教程,搭建公司自己用的linux git服务器,在github上发布自己的简历.zip
极其详细的gitHub使用手册,教会你快速学习gitHub
Github使用教程.zip 身为程序员,怎么能不会使用github呢
github个人使用笔记,如何使用github开发,这是一个趋势。
Eclipse与github安装使用 自己测试能用
github漫游指南,详细的介绍github的使用
Git与Github教程详细介绍了Git的工作机制,Git命令行的基础学习,Git-Eclipse和Nginx的准备工作,Git与Github分支体系,Git与Github的远程和本地工作原理,Git与Github克隆实战和最后的课程精华总结部分,可以帮助...
Github入门与实践 高清PDF Github入门与实践 高清PDF Github入门与实践 高清PDF
前段时间开发书架在github 上面找的参考资源