莫烦python:https://morvanzhou.github.io/tutorials/others/git/5-1-github/
建立 github 版本库
在 github 注册一个 github 账户, 这个不用我多说, 大家都知道注册.
然后添加你的一个 online 版本库 repository:
添加好了以后, 会出现下面的介绍, 你可以选择红框里的代码链接上你的本地版本库.
连接本地版本库
$ git remote add origin https://github.com/MorvanZhou/git-demo.git
$ git push -u origin master # 推送本地 master 去 origin
$ git push -u origin dev # 推送本地 dev 去 origin
现在网上就已经有了你推上去的版本库了.
你甚至能在这里观看之前有哪些 commit
和 commit
具体做了什么:
推送修改
如果在本地再进行修改, 比如在 1.py
文件中加上 # happy github
, 然后 commit
并推上去:
$ git commit -am "change 5"
$ git push -u origin master
github 中就会查到这个: