git config --global user.name "xxx"
git config --global user.email "xxx@qq.com"
1.创建版本库
进入对应的路径
git init
会有.git目录
2.将文件添加到版本库中
1.在目录下 新建 readme.txt 内容 111
git add readme.txt
2.
git commit -m 'readme.txt提交' //注释
3.查看是否还有未提交
git status
4.修改readme.txt 在下面添加 222 ,继续 git status 会提示没被提交
5.查看修改了什么
git diff readme.txt
继续提交
git add readme.txt
git commit -m "文件增加333内容"
6.日志
git log --pretty=oneline
7.回退
git reset --hard HEAD^ //上个
git reset --hard HEAD~100 //前100个版本
8 . git reflog
git reflog来查 然后恢复到版本号
git reset --hard {版本号}