github的使用

感谢该教程
http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000

下面是我的操作方式:

在github注册不多说了

安装客户端软件

下载地址
https://git-for-windows.github.io/

安装后进行配置:

$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"

创建文件夹,进入当前文件夹,比如d:/github

第二步,通过git init命令把这个目录变成Git可以管理的仓库:

$ git init
Initialized empty Git repository in /Users/michael/learngit/.git/

瞬间Git就把仓库建好了,而且告诉你是一个空的仓库(empty Git repository),细心的读者可以发现当前目录下多了一个.git的目录,这个目录是Git来跟踪管理版本库的,没事千万不要手动修改这个目录里面的文件,不然改乱了,就把Git仓库给破坏了。

测试提交文件

将一个文本文件放入d:/github中,比如readme.txt

添加文件

git add readme.txt

提交

git commit -m "wrote a readme file"

将已有的本地仓库与github库做关联

git remote add origin https://github.com/adikshfklsadhjf/pachong.git

上传本地当前分支代码到master分支,如果第一次执行该命令,会弹出登录窗口,输入github用户名、密码登录

git push -u origin master

原文出处:/show_1C7Zg5lkvh2.html