二. 本地版本库关联到GitHub



一. Git与GitHub


在本地使用Git进行版本管理, 你也可以把你的版本上传到网络上, GitHub就提供这样的服务.
https://github.com/


二. GitHub的使用


打开网页
https://github.com/, 在上面注册你自己的GitHub账号.


三. 本地版本与GitHub上的版本管理步骤


3.1 创建本地的版本库


参考:
http://blog.csdn.net/bagboy_taobao_com/article/details/42642613


3.2 在GitHub上创建版本


...

本地的Git要与GitHub通信, 必须创建SSH Key, 并关联到GitHub上, SSH Key的创建过程参考:

http://blog.csdn.net/bagboy_taobao_com/article/details/42584405


3.3 本地版本与GitHub版本关联


(其实在GitHub上创建版本后, 就生成了一些命令, 这些命令就是帮助我们进行本地版本库与GitHub的关联的.)

输入如下两条命令:

git remote add originhttps://github.com/cay22/TestGit1.git

git push -u origin master


Administrator@xxxxxxxxxx /E/Stu/TestGit1 (master)
$ git remote add origin
https://github.com/cay22/TestGit1.git

Administrator@xxxxxxxxxx /E/Stu/TestGit1 (master)
$ git push -u origin master
Username for 'https://github.com': cay22
Password for 'https://cay22@github.com':
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (5/5), 316 bytes | 0 bytes/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To
https://github.com/cay22/TestGit1.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.


3.4 看一下GitHub上的TestGit1


此时你发现, 本地的版本库已经上传到GitHub了.


四. 个人理解


1. Git与GitHub的关系是并列关系, 不是客户端与服务端的关系.
2. 可以认为你把你本地的版本库关联到GitHub, 就是一次备份而已.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值