Git入门
虽然没有完全懂意思,但是还是记录下来流程,只要按照流程走,就不会出错
1.首先创建目录作为我们的项目目录 mkdir git-demo-1

2.进入git-demo-1 cd ~/git-demo-1

3.git init 这句命令会在 git-demo-1 里创建一个 .git 目录 git init

4.查看当前路径 ls -la(显示更多信息),你可以看到一个.git目录,他就是一个目录

5.新建1个目录,两个文件 新建目录:madir css
新建文件:touch index.html touch style.css

6.运行git status -sb,试试

你会发现

遇到问好一脸懵逼,放心,我也一脸懵逼,都不知道是啥玩样儿,不管了,按照步骤继续吧
7.git add XXX,就是把这两个问好文件添加到暂存区,Add就是添加的意思

7.输入这个命令后,再运行git status -sb,试试

问好变成A了有么有,是不是很神奇,为什么会这样?别问我,我也不知道(官方解释:A 的意思就是添加,也就是说你告诉 git,这些文件我要加到仓库里)
8.第七步的步骤是讲文件添加到暂存区,那么第八个步骤就是把之前的文件正式提交到本地的仓库,运行命令:git commit index.html -m'添加 index.html'
git commit style.css -m'添加style.css'
(.git就是本地仓库)

刚开始学,还是老老实实一个一个添加,熟悉熟悉代码也是可以的
9.再去试试看git status -sb

发现没有文件了有木有,别慌,说明都已经上传到本地仓库上去了
10.你可以输入git log,查询一下

你可以看用户名,改动日期,添加的文件都已经全部上传了,666
以上就是 git add / git commit 的一次完整过程
我完成第二次作业博客啦!!!
2018年7月8日
网友评论