{"id":13399565,"url":"https://github.com/xirong/my-git","last_synced_at":"2026-10-18T23:06:14.023Z","repository":{"id":32957278,"uuid":"36560369","full_name":"xirong/my-git","owner":"xirong","description":"Git as the control plane for AI-native software engineering | AI Native 软件工程的 Git 变更控制手册","archived":false,"fork":false,"pushed_at":"2026-09-09T09:44:31.000Z","size":22965,"stargazers_count":7397,"open_issues_count":6,"forks_count":2473,"subscribers_count":459,"default_branch":"master","last_synced_at":"2026-10-15T03:34:34.872Z","etag":null,"topics":["ai-coding","ai-native-development","git","git-flow","git-workflow","gitflow","github","github-flow"],"latest_commit_sha":null,"homepage":"https://github.com/xirong/my-git","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dgryski/go-expirecache","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xirong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":"MAINTAINERS.md","copyright":null,"agents":"AGENTS.md","claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null}},"created_at":"2015-05-30T14:02:04.000Z","updated_at":"2026-10-13T08:28:08.000Z","dependencies_parsed_at":"2026-08-19T14:16:11.785Z","dependency_job_id":null,"html_url":"https://github.com/xirong/my-git","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/xirong/my-git","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xirong%2Fmy-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xirong%2Fmy-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xirong%2Fmy-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xirong%2Fmy-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xirong","download_url":"https://codeload.github.com/xirong/my-git/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xirong%2Fmy-git/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38343410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-18T02:00:06.448Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-coding","ai-native-development","git","git-flow","git-workflow","gitflow","github","github-flow"],"created_at":"2024-07-30T19:00:39.555Z","updated_at":"2026-10-18T23:06:14.016Z","avatar_url":"https://github.com/xirong.png","language":"HTML","funding_links":[],"categories":["Others","工具","Version Control","Uncategorized"],"sub_categories":["Ethereum","Uncategorized"],"readme":"# My Git Handbook\n\n[English](README_en.md) | 中文\n\n面向 AI Native 软件工程的 Git 变更控制手册：理解原理，验证改动，管理协作。\n\n## AI 会操作，人为什么还要学？\n\nAI 可以代劳命令，理解决定我们能看见哪些选择、提出什么问题，以及凭什么接受结果。脑中没有一个概念，遇到问题时就很难想到用它。\n\n我维护这个仓库，是希望把 Git 中值得传承的设计讲清楚：快照如何记录状态，对象如何复用内容，引用如何组织历史，以及协作如何处理分歧。让这些思想成为人的判断依据，让 AI 帮助我们实验、执行和验证。\n\n**学习的重心，从熟练执行，走向理解、判断与验证。** 操作仍然值得练习，尤其是读懂关键命令和识别风险；实践是检验理解的方式。\n\n[读完整理念](01-getting-started/why-learn-git.md) · [直接打开交互学习](https://xirong.github.io/my-git/interactive/git-mental-model/)\n\n## 从理解设计到管理协作\n\n先用[知识地图](01-getting-started/knowledge-map.md)确认自己正在解决的是原理、一次工程变更还是团队协作，再进入下面的文章。\n\n| 你想获得什么 | 从这里开始 | 学会后能判断什么 |\n| --- | --- | --- |\n| 理解设计 | [交互学习](https://xirong.github.io/my-git/interactive/git-mental-model/) → [完整学习路径](01-getting-started/git-learning-path.md) | 改动存在哪里，历史如何形成，恢复依赖什么 |\n| 完成工程变更 | [一次变更的完整验收](05-ai-native-development/ai-change-control-loop.md) → [AI 变更审查样例](05-ai-native-development/ai-change-review-example.md) | 范围、提交版本和测试证据是否对应 |\n| 管理协作 | [团队 Git 工作流指南](03-team-collaboration/team-git-workflow-guide.md) → [GitHub 工程治理](04-github-engineering/github-engineering-governance.md) | 如何隔离、审查、授权、发布与恢复 |\n\nGit 提供版本与历史的基础。测试、审查、权限、制品和发布系统一起，才能形成完整的变更控制。这里既讲工具的能力，也讲它的边界。\n\n## 适合谁\n\n- Git 新手，希望建立正确心智模型\n- 普通开发者，经常需要处理冲突、回滚、误提交\n- 高级开发者，关心 PR、Review、CI、发布协作\n- 技术负责人，需要设计团队 Git 工作流和 GitHub 治理规范\n- AI 编程用户，需要控制 Codex、Claude Code、Cursor、Cline 等工具带来的代码变更风险\n\n## 目录导航\n\n| 目录 | 主要内容 |\n| --- | --- |\n| [01-getting-started](01-getting-started/) | Git 入门、心智模型，以及[知识地图](01-getting-started/knowledge-map.md) |\n| [02-daily-workflow](02-daily-workflow/) | 日常命令、分支合并、rebase、stash、worktree |\n| [03-team-collaboration](03-team-collaboration/README.md) | 团队工作流、PR、Code Review、协作模型选型 |\n| [04-github-engineering](04-github-engineering/README.md) | 分支保护、Rulesets、CODEOWNERS、CI、发布、安全 |\n| [05-ai-native-development](05-ai-native-development/README.md) | AI 编程下的 diff 审查、commit 拆分、worktree、多 Agent |\n| [06-troubleshooting](06-troubleshooting/README.md) | Git 误操作恢复、冲突处理、secret 清理、force push 恢复 |\n| [07-large-repo](07-large-repo/README.md) | 大仓库、monorepo、partial clone、sparse checkout、Git LFS |\n| [08-templates](08-templates/README.md) | PR、Issue、Review、Hotfix、Release、AI Review 模板 |\n| [10-company-practices](10-company-practices/README.md) | 大厂工程实践案例和决策图谱 |\n\n## 在线交互学习\n\n通过动画、文章和临时仓库实验理解 Git 的快照、对象图、引用、历史变化、远端、worktree 与存储。十个主题按同一顺序安排，01 至 03 对应既有交互，04 至 10 对应新增交互；材料与脚本可检查，读者理解仍需要用预测、重现和迁移来验证。\n\n[打开 Git 心智模型交互实验](https://xirong.github.io/my-git/interactive/git-mental-model/)\n\n[查看十个主题的文章、交互与实验导航](01-getting-started/git-learning-path.md)\n\n## 学习路径\n\n### 新手路径\n\n1. [为什么在 AI 时代学习 Git](01-getting-started/why-learn-git.md)\n2. [Git 心智模型](01-getting-started/git-mental-model.md)\n3. [十个主题的课程导航](01-getting-started/git-learning-path.md)：每个主题都连接文章、交互和临时仓库实验。\n4. [Git 基础命令](01-getting-started/git-basic-commands.md)\n5. [日常 Git 命令](02-daily-workflow/everyday-git-commands.md)\n\n### 日常开发路径\n\n1. [分支与合并](02-daily-workflow/branch-and-merge.md)\n2. [Rebase 与 Merge](02-daily-workflow/rebase-vs-merge.md)\n3. [Stash](02-daily-workflow/stash.md)\n4. [Worktree](02-daily-workflow/worktree.md)\n\n### 团队协作路径\n\n1. [团队 Git 工作流指南](03-team-collaboration/team-git-workflow-guide.md)\n2. [GitLab Flow](03-team-collaboration/gitlab-flow.md)\n3. [Pull Request 最佳实践](03-team-collaboration/pull-request-best-practices.md)\n4. [Code Review 最佳实践](03-team-collaboration/code-review-best-practices.md)\n5. [GitHub Flow](03-team-collaboration/github-flow.md)\n6. [Trunk-Based Development](03-team-collaboration/trunk-based-development.md)\n7. [Gitflow](03-team-collaboration/gitflow.md)\n\n### GitHub 工程治理路径\n\n1. [GitHub 工程治理手册](04-github-engineering/github-engineering-governance.md)\n2. [企业 GitHub 协作配置栈](04-github-engineering/enterprise-github-workflow-stack.md)\n3. [分支保护](04-github-engineering/branch-protection.md)\n4. [Rulesets](04-github-engineering/rulesets.md)\n5. [Merge Queue](04-github-engineering/merge-queue.md)\n6. [GitOps and Config as Code](04-github-engineering/gitops-and-config-as-code.md)\n7. [发布管理](04-github-engineering/release-management.md)\n8. [AI Agent 治理](04-github-engineering/ai-agent-governance.md)\n\n### AI Native 开发路径\n\n1. [一次工程变更课程](05-ai-native-development/engineering-change-course.md)\n2. [接受 Agent 变更](05-ai-native-development/ai-change-control-loop.md)\n3. [AI 生成变更的 CI](05-ai-native-development/ci-for-ai-generated-changes.md)\n4. [后台 Agent 任务](05-ai-native-development/background-agent-workflow.md)\n5. [AI Native Git Workflow](05-ai-native-development/ai-native-git-workflow.md)\n6. [AI 生成代码 Review](05-ai-native-development/ai-generated-code-review.md)\n7. [Codex / Claude Code Git 实践](05-ai-native-development/codex-claude-code-git-practices.md)\n8. [AI 编程工具的 Git 集成实践](05-ai-native-development/ai-coding-tools-git-integration.md)\n9. [Worktree for AI Agents](05-ai-native-development/worktree-for-ai-agents.md)\n10. [Stacked PR for AI-Generated Changes](05-ai-native-development/stacked-pr-for-ai-generated-changes.md)\n11. [AI Reviewer 与 Human Reviewer](05-ai-native-development/ai-reviewer-and-human-reviewer.md)\n12. [AI 协作度量](05-ai-native-development/ai-collaboration-metrics.md)\n\n### 故障处理路径\n\n1. [Git 高频事故处理手册](06-troubleshooting/git-troubleshooting-playbook.md)\n2. [Agent 事故恢复](06-troubleshooting/ai-agent-incident-recovery.md)\n3. [Undo Anything](06-troubleshooting/undo-anything.md)\n4. [Recover Lost Commit](06-troubleshooting/recover-lost-commit.md)\n5. [Remove Secret from History](06-troubleshooting/remove-secret-from-history.md)\n\n## 按问题找答案\n\n| 我现在遇到的问题 | 建议先看 |\n| --- | --- |\n| 刚把 commit 提交到了错误分支 | [Committed to Wrong Branch](06-troubleshooting/committed-to-wrong-branch.md) |\n| reset、rebase、force push 后不知道怎么恢复 | [Git 高频事故处理手册](06-troubleshooting/git-troubleshooting-playbook.md) |\n| 团队不知道该选 GitHub Flow、Gitflow 还是 Trunk-Based Development | [团队 Git 工作流指南](03-team-collaboration/team-git-workflow-guide.md) |\n| PR 太大，Review 很慢 | [Pull Request 最佳实践](03-team-collaboration/pull-request-best-practices.md) |\n| AI 一次改了很多文件，不知道怎么审 | [AI 变更审查实战样例](05-ai-native-development/ai-change-review-example.md) |\n| AI 生成的大 diff 需要拆 commit 或拆 PR | [AI Commit Splitting](05-ai-native-development/ai-commit-splitting.md)、[Stacked PR for AI-Generated Changes](05-ai-native-development/stacked-pr-for-ai-generated-changes.md) |\n| 想保护 main 分支 | [Branch Protection](04-github-engineering/branch-protection.md) |\n| AI agent 开始直接提交代码、发 PR，不知道怎么管 | [AI Agent 治理](04-github-engineering/ai-agent-governance.md) |\n| 想给团队仓库写一份 agent 协作约定 | [AGENTS.md 模板](08-templates/agents-md-template.md) |\n| PR 很多，主分支经常被合坏 | [Merge Queue](04-github-engineering/merge-queue.md) |\n| 大仓库 clone、status、checkout 很慢 | [Large Repository Git Practices](07-large-repo/large-repo-git-practices.md) |\n| 想直接复制团队模板 | [Templates](08-templates/) |\n\n## 第一阶段最值得读\n\n- [AI Native Git Workflow](05-ai-native-development/ai-native-git-workflow.md)\n- [Codex / Claude Code Git 实践](05-ai-native-development/codex-claude-code-git-practices.md)\n- [AI 编程工具的 Git 集成实践](05-ai-native-development/ai-coding-tools-git-integration.md)\n- [AI 变更审查实战样例](05-ai-native-development/ai-change-review-example.md)\n- [Stacked PR for AI-Generated Changes](05-ai-native-development/stacked-pr-for-ai-generated-changes.md)\n- [Git 高频事故处理手册](06-troubleshooting/git-troubleshooting-playbook.md)\n- [团队 Git 工作流指南](03-team-collaboration/team-git-workflow-guide.md)\n- [GitHub 工程治理手册](04-github-engineering/github-engineering-governance.md)\n- [企业工程实践案例库](10-company-practices/README.md)\n- [大厂工程实践决策图谱](10-company-practices/company-practices-decision-map.md)\n- [AI 代码 Review 清单](08-templates/ai-code-review-checklist.md)\n\n## 推荐资料来源\n\n新内容会优先参考官方文档和业界常用资料：\n\n- [Pro Git](https://git-scm.com/book/en/v2)\n- [Git 官方文档](https://git-scm.com/docs)\n- [GitHub Docs](https://docs.github.com)\n- [Atlassian Git tutorials](https://www.atlassian.com/git)\n- [Trunk Based Development](https://trunkbaseddevelopment.com)\n- [Git Flight Rules](https://github.com/k88hudson/git-flight-rules)\n\n更完整的资料索引见 [推荐阅读](09-resources/recommended-reading.md)。\n\n## 版本与维护计划\n\n详细计划见 [roadmap](00-meta/roadmap.md)。\n\n课程、修复和协作材料已整理为 [v2.2.0 发布说明](00-meta/release-notes-v2.2.0.md)与 [Changelog](00-meta/changelog.md)。发布文档准备日期为 2026-09-09；版本状态见 [GitHub Releases](https://github.com/xirong/my-git/releases)。\n\n已有内容会逐步纳入新的学习路径，迁移清单见 [legacy content migration](00-meta/legacy-content-migration.md)，资料索引见 [resources](09-resources/resources-index.md)。\n\n## 项目治理\n\n- [License](LICENSE)\n- [Contributing](CONTRIBUTING.md)\n- [Roadmap](ROADMAP.md)\n- [Maintainers](MAINTAINERS.md)\n- [Agent 协作约定](AGENTS.md)\n\n本仓库原创内容采用 MIT License。第三方资料、历史电子书、外部文章、链接资源和引用内容仍遵循其原始许可证和版权声明。\n\n## Contributing\n\n欢迎贡献真实问题、团队实践、事故恢复经验、AI 编程工作流和可复用模板。\n\n新内容请遵循 [Content Style Guide](00-meta/content-style-guide.md)。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxirong%2Fmy-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxirong%2Fmy-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxirong%2Fmy-git/lists"}