一. 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, 就是一次备份而已.