
2.将项目所有文件添加到仓库缓冲区(避免误操作的区域,只是一个中转作用):git add .

若要添加某个特定文件到仓库,则把.换成该文件名即可

3.将add的文件commit到仓库版本区:git commit -m "注释语句"

4.在github上创建仓库:

5.点击Create repository创建仓库并获取它的链接地址用于关联本地仓库:

6.本地仓库关联远程github:

7.在将文件上传到github时,先pull:git pull origin master

8.最后上传代码:git push -u origin master

报错:拒绝合并无关历史 9.添加命令,允许合并无关历史:--allow-unrelated-histories

10.再git push:输入用户名,密码之类。

11.查看github,已完成Push

12.git status:列出当前所有还没有被git管理的文件以及被git管理且已经修改过但还未提交的文件。

13.git log:查看提交记录

14.git diff: 查看修改记录,查看工作区和缓冲区文件的差异
