mkdir git-demo-1 ----- 创建一个名为 git-demo-1的空文件夹
cd git-demo-1 ----- 进入 git-demo-1这个文件夹里面
git init ----- 创建一个本地git仓库,也叫git仓库初始化

然后创建一些文件
touch index.html ---- 创建index.html文件
mkdir css ---- 创建css文件夹
touch css/style.css ---- 在css文件夹里创建style.css文件
git status -sb ---- 查看git-demo-1这个文件夹有什么改动的地方


现在把我们修改的内容提交到本地仓库
git add . ---- 将所有改动的文件都添加到缓存,
git commit -am "备注信息" ---- 将本地缓存的的文件添加到本地git仓库,
git status -sb ---- 再次查看有改动的文件
这里我们可以看到,在commit的时候,会罗列出来commit了那些文件,等commit完成后,再次查看,就显示没有文件被改动过了。

网友评论