Git Ops v2.0
安全原则
git status先检查再操作- 未保存改动先 stash/commit
- pull前确保干净
- 不强制回退已推送提交
速查
状态
git status / git log --oneline -20 / git diff / git branch -a
暂存提交
git add <file> / git add -A / git commit -m "msg" / git commit --amend
分支
git branch <name> / git checkout -b <name> / git merge <branch> / git branch -d
同步
git pull --rebase / git push / git push -u origin <branch> / git fetch
暂存
git stash / git stash pop / git stash list
撤销
git reset <file> / git checkout -- <file> / git revert <commit>
标签
git tag v1.0.0 / git tag -a v1.0.0 -m "msg" / git push origin v1.0.0
最佳实践
分支: feature/fix/chore | Commit: Conventional Commits | 经常pull | 一个大功能=一个分支+多个小commit
评论
加载中…