--- id: devops.git.index title: Git type: index domain: devops stack: [git] tags: [Git, 版本控制, 分支, 协作] week: [1, 8, 15] --- # Git 七年前端,Git 日常操作你已经熟悉。这个专题补的是**面试和团队协作里容易被追问的部分**:分支模型怎么选、merge 和 rebase 的区别、怎么安全地撤销、误操作怎么找回、密钥误提交怎么处理。本计划的学习仓库本身也按这些规范管理。 ## 学习路线 | 顺序 | 课程 | 级别 | 预计 | | --- | --- | --- | --- | | 1 | [分支模型和提交规范:主干开发、Git Flow、Conventional Commits、代码评审](01-branch-commit.md) | 基础 | 1.5 小时 | | 2 | [合并、变基和撤销:merge / rebase / cherry-pick、revert / reset、reflog 找回](02-merge-rebase-recovery.md) | 进阶 | 2 小时 | ## 企业场景 - [线上紧急修复和密钥误提交:热修复分支、cherry-pick、清理历史和轮换密钥](scenarios/hotfix-and-leaked-secret.md) ## 面试题 - [Git 面试题](interview.md) ## 示例代码 - [examples/git-lab](examples/git-lab/):`lab.py` 在临时目录里自动演示并验证 rebase、`--no-ff` 合并、revert、reflog 找回、cherry-pick ## 在 16 周计划中 - [第 1 周:仓库和提交规范](../../../plan/week01-go-gin.md)、[第 8 周:整理项目仓库](../../../plan/week08-inventory-architecture.md)、[第 15 周:作品集打包](../../../plan/week15-package-resume.md) ## 官方资料 - Pro Git(中文版):https://git-scm.com/book/zh/v2 - Git 命令参考:https://git-scm.com/docs - Conventional Commits:https://www.conventionalcommits.org/zh-hans/