命令 作用
git add 文件名称 工作区提交暂存区
git commit -m 文件名称 暂存区提交本地仓库
git status 查看文件状态
git diff 文件名 工作区与暂存区比较
git diff head 文件名 工作区与本地库比较
git diff --cached 文件名 暂存区与本地库比较
git log 查看当前操作日志
git reflog 查看所有操作日志
git reset --hard head^ 回退上一个版本
git reset --hard 版本号 回退到指定版本
git checkout 文件名 工作区撤消
git reset head 文件名 暂存区撤消
git branch 分支名称 创建分支
git checkout 分支名称 切换分支
git meger 分支名称 合并分支
git branch 查看分支
git branch -d 分支名称 删除分支
git remote add origin 远程仓库 关联
git pull 拉取
git push 推送
git clone 远程仓库 克隆