速查手册:
https://zhuanlan.zhihu.com/p/653956611
1. 拉取远程代码
git clone xxx.git
2. 将文件添加到暂存区
git add .
3. 查看所有文件状态
git status
4. 将文件从暂存区删除
git rm --cached [文件名]
5. 将暂存区文件提交到本地仓库
git commit -m '该次提交说明'
6. 反做,本地仓库退回指定提交版本
git revert [commitID]
7. 本地仓库同步远程版本
git reset --hard origin/master
8. 上传到远程仓库
git push
9. 不喜欢在旧版本上增加新功能代码,可以将修改的代码暂存。如何重新 pull 代码,再把暂存的更改导入
git stash
git pull origin master
git stash pop