1. Git初始化本地仓库
- 创建文件夹
- 打开Git Bash
-
)右键options,设置窗口大小和字符集
-
)一些操作
git --version #清屏操作 clear #设置签名-设置用户名和邮箱 git config --global user.name "username" git config --global user.email "EmailAddr"
-
- 本地仓库的初始化操作:
# 初始化操作 .git是隐藏目录
git init
查看.git目录下文件内容(不要随意修改此目录下的文件内容)
2. Git常用命令
- 查看状态
# 查看状态
git status
# 将文件提交到暂存区
git add FileName
# 将暂存区文件提交到本地库
# -m:message 提交说明
git commit -m "注释内容"
- 查看提交记录
# 查看提交记录--分页效果
# 记录记录过多时,空格-下一页 b-上一页 到尾显示END 推出q
git log
# 将提交的历史记录展示成一行
git log --pretty=oneline
# 更加简洁的展示
git log --oneline
# 展示了HEAD@{NUM} 指针回到当前这个历史版本需要回退几步
git reflog
- reset 命令:前进或者后退历史版本
git reset --hard ${INDEX}
2NB1C4OWXS-eyJsaWNlbnNlSWQiOiIyTkIxQzRPV1hTIiwibGljZW5zZWVOYW1lIjoi5r+A5rS75Zyw5Z2AIGlkZWHCt21lZGVtaW5nwrdjb20iLCJhc3NpZ25lZU5hbWUiOiIiLCJhc3NpZ25lZUVtYWlsIjoiIiwibGljZW5zZVJlc3RyaWN0aW9uIjoiIiwiY2hlY2tDb25jdXJyZW50VXNlIjpmYWxzZSwicHJvZHVjdHMiOlt7ImNvZGUiOiJEQyIsInBhaWRVcFRvIjoiMjAyMS0wMS0yMCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMjEtMDEtMjAiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IkRCIiwicGFpZFVwVG8iOiIyMDIxLTAxLTIwIiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJSTSIsInBhaWRVcFRvIjoiMjAyMS0wMS0yMCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiV1MiLCJwYWlkVXBUbyI6IjIwMjEtMDEtMjAiLCJleHRlbmR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