git clone 仓库克隆 git pull 代码拉取 git push 代码推送 git add 保存代码至暂存区 git commit -m XXX 提交暂存区的文件到仓库 git branch 查看分支 git checkout 分支名 切换至指定分支 git checkout -b 分支名 新建分支 git branch 分支名 新建分支 git merge 分支名 指定分支合并至当前分支 git remote add 远程仓库名 远程分知名 添加远程仓库 git status 查看状态 git diff 比较工作区和暂存区差异 git diff commit1 commit2 比较两个版本之间的差异 git reset HEAD 文件名 将文件从暂存区移除 git checkout --文件名 撤销对文件的修噶 git revert commit 撤销指定提交 git reset --hard commit 代码回滚