git status //有两种颜色,一种是绿色,一种是红色
红色为刚更改完
1,最开始流程
git init
git add * //变成绿色
git commit -m “注释,可以写上修改内容”
查看在最后一次提交之后的所有变更
git differ HEAD
查看添加(add)而并未提交(commit)的变更
git diff --staged
创建一个本地仓库的克隆版本
git clone /path/to/repository
查看所有项目日志
git log
查看最新版本
git log -x //x为最新的版本数量
查看某文件的日志
git log
查看本目录的日志
git log.
查看版本变化
git reflog
查看以前版本
切换为head的前一版本:git reset --hard HEAD^
切换为head的前2版本: git reset --hard HEAD^
切换为head的前100版本:git reset --hard HEAD^100
切换到某一版本号: git reset --hard <版本号>
查看分支
git branch
创建分支
git branch <分支>
切换分支
git checkout <分支>
合并分支
git merge <分支>
删除分支
git branch -d <分支>