首先来了解下git流程的概念图

工作区,版本库,暂存区概念图
理解之后,我们在本地自己玩一下。
1.在本地GIT仓库新建一个文件,first.txt

新建first.txt
2.在GIT中,输入 git status ,查询信息

git status查询信息
3.输入 ,git add 文件名 ,再次输入git status查询信息

git add <文件名>

git status查看当前信息
4.输入,git commit -m "提示信息"

提交
如果提示出现*** Please tell me who you are.说明目前没有设置用户名

异常,没有设置邮箱及用户名
使用:$ git config --global user.eamil 邮箱名 (图中‘=’为错误示范,不需要)
$ git config --global user.name 姓名
设置自己的邮箱和账户
5.设置好信息后,再次输入git commit -m "提示信息"

继续提交操作
6.输入git push ,将commit文件推到远端gits上,就不上图了。
PS:有些第一次使用git同学,会出现以下异常
git push:fatal the current branch master has no upstream branch
这是要确定你推到哪个分支,使用如下图方法,推到master主分支,解决。

git push并选择推到master主分支