一.Git安装(windows)
1.进入Git 官网:https://git-scm.com/
2.默认安装(傻瓜式)
3.开始
Git bash
或 在d盘新建个文件夹作为本地仓库(可以使用命令行 或windows新建)
4.填写user.name (git上的用户名) user.email(注册git的邮箱)
这里我在分支进行演示忽略(newBranch)
这是在仓库的.git config中设置了默认的信息
5. 创建版本库
git init
工作区 :pc硬盘
本地库.git
暂存区(索引):存放在.git/index中
6.新建文件夹
demo .txt (windows)
命令行:touch demo.txt
vim demo.txt
less demo.txt
cat demo.txt
7.将文件夹添加到暂存区 :git add demo.txt
8.查看暂存区状态:
git status
9. 提交并注释
git commit -m“ 提交”
10.查看暂存区信息
git status git log 文件名 历史记录
git reflog 查看历史记录的版本号
git reset --hard HEAD 回到上一次提交
git reset -- hard HEAD~n(数) 回退 n次操作
这时可能出现git 的登陆界面
输入相关信息 进入git 自己的仓库查看