git init 把当前所在目录变成git可管理的目录
git add <file1> <file2> 把文件提交到暂存区
git rm <file1> <file2> 删除文件(这个也要commit)
git commit -m "备注" 把暂存区所有文件提交到当前分支 -m "备注" 可省略 但不推荐
git status 查看当前状态
git diff HEAD -- <file> 查看工作区和最新版本库的区别(HEAD表示当前分支指向,这里是master)
git log 显示提交日志
参数 --pretty=oneline 一行输出
--graph
git reset --hard commit_id 回到commit_id对应的版本
git reflog 查看以前的命令
git checkoout -- <file> 用版本库的版本替换工作区的file版本
git reset HEAD <file> 把在暂存区内的修改撤销
git merge <branch> 把branch合并到当前分支
1036

被折叠的 条评论
为什么被折叠?



