xirong/my-git
xirong/my-git has 7,403 GitHub stars and 2,470 forks. Star changes are not measured yet. Last checked 2026-11-07 18:01 UTC. Last push 2026-09-09.
Git as the control plane for AI-native software engineering | AI Native 软件工程的 Git 变更控制手册
Measured star growth
- in 24h
- Update delayed
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README_en.md
OriginalMy Git Handbook
English | 中文
A Git change-control handbook for AI-native software engineering: understand the design, verify changes, and manage collaboration.
Why learn when AI can run the commands?
AI can carry out operations. Understanding shapes the options we notice, the questions we ask, and the evidence we require before accepting a result. Without a concept in mind, we may never think to use it.
I maintain this handbook to explain enduring ideas in Git: how snapshots record state, how objects reuse content, how references organize history, and how collaboration handles divergence. These ideas support human judgment; AI helps us experiment, execute, and verify.
The emphasis shifts from execution fluency toward understanding, judgment, and verification. Practical skills still matter, especially reading critical commands and recognizing risk. Practice tests understanding.
Read the philosophy · Start learning interactively
From understanding design to managing collaboration
Use the knowledge map to identify whether you are solving a conceptual question, one engineering change, or team collaboration before entering the articles below.
| What you want to develop | Start here | What you will be able to judge |
|---|---|---|
| Understand the design | Interactive learning → Learning path | Where changes live, how history forms, and what recovery depends on |
| Complete an engineering change | Accept a change end to end → Review example | Whether scope, commit revision, and test evidence agree |
| Manage collaboration | Team Git Workflow Guide → GitHub governance | How to isolate, review, authorize, release, and recover |
Git supplies versions and history. Tests, review, permissions, artifacts, and release systems complete change control. This handbook covers both the tool’s capabilities and their limits.
Who Is This For?
- Git beginners looking to build the right mental model.
- Practicing developers who frequently need to handle conflicts, rollbacks, and accidental commits.
- Senior developers focused on PRs, Review, CI, and release collaboration.
- Technical leads who need to design team Git workflows and GitHub governance standards.
- AI coding users who need to control the risks of code changes brought by tools like Codex, Claude Code, Cursor, and Cline.
Directory Navigation
| Directory | Problems Solved |
|---|---|
| 01-getting-started | Git basics, mental models, and the knowledge map |
| 02-daily-workflow | Daily commands, branching and merging, rebase, stash, and worktree |
| 03-team-collaboration | Team workflows, PRs, Code Review, and selecting collaboration models |
| 04-github-engineering | Branch protection, Rulesets, CODEOWNERS, CI, releases, and security |
| 05-ai-native-development | Diff review, commit splitting, worktree, and multi-agent strategies for AI coding |
| 06-troubleshooting | Recovering from Git mishaps, conflict resolution, secret cleaning, and force push recovery |
| 07-large-repo | Large repositories, monorepos, partial clone, sparse checkout, and Git LFS |
| 08-templates | Templates for PRs, Issues, Reviews, Hotfixes, Releases, and AI Reviews |
| 10-company-practices | Enterprise engineering practice cases and decision maps |
Interactive Learning
Use animations, articles, and temporary-repository labs to understand Git snapshots, the object graph, references, history transformations, remotes, worktrees, and storage. The ten topics follow one sequence: 01 through 03 use the existing interactives and 04 through 10 use the added interactives. Material and scripts can be checked; reader understanding still needs prediction, reproduction, and transfer.
Open the Git Mental Model Interactive Lab
View the ten-topic article, interactive, and lab navigation
Learning Paths
Beginner Path
- Why Learn Git in the AI Era
- Git Mental Model
- Ten-topic course navigation: each topic connects an article, interactive, and temporary-repository lab.
- Git Basic Commands
- Everyday Git Commands
Daily Development Path
Team Collaboration Path
- Team Git Workflow Guide
- GitLab Flow
- Pull Request Best Practices
- Code Review Best Practices
- GitHub Flow
- Trunk-Based Development
- Gitflow
GitHub Engineering Governance Path
- GitHub Engineering Governance Manual
- Enterprise GitHub Workflow Stack
- Branch Protection
- Rulesets
- Merge Queue
- GitOps and Config as Code
- Release Management
- AI Agent Governance
AI Native Development Path
- Engineering Change Course
- Accept an Agent Change
- CI for AI-Generated Changes
- Background Agent Tasks
- AI Native Git Workflow
- AI-Generated Code Review
- Codex / Claude Code Git Practices
- Git Integration Practices for AI Coding Tools
- Worktree for AI Agents
- Stacked PR for AI-Generated Changes
- AI Reviewer and Human Reviewer
- AI Collaboration Metrics
Troubleshooting Path
- Git Troubleshooting Playbook
- AI Agent Incident Recovery
- Undo Anything
- Recover Lost Commit
- Remove Secret from History
Find Answers by Problem
| The problem I'm facing | Suggested reading |
|---|---|
| Just committed to the wrong branch | Committed to Wrong Branch |
| Don't know how to recover after reset, rebase, or force push | Git Troubleshooting Playbook |
| Team doesn't know whether to choose GitHub Flow, Gitflow, or Trunk-Based Development | Team Git Workflow Guide |
| PR is too large, review is slow | Pull Request Best Practices |
| AI changed too many files at once, don't know how to review | AI Change Review Examples |
| Large AI-generated diff needs to be split into commits or PRs | AI Commit Splitting, Stacked PR for AI-Generated Changes |
| Want to protect the main branch | Branch Protection |
| AI agents are pushing code and opening PRs, and I don't know how to govern them | AI Agent Governance |
| Want an agent collaboration convention for the team repository | AGENTS.md Template |
| Too many PRs, main branch often broken after merge | Merge Queue |
| Clone, status, or checkout is slow in a large repository | Large Repository Git Practices |
| Want to directly copy team templates | Templates |
Phase 1: Must-Read Articles
- AI Native Git Workflow
- Codex / Claude Code Git Practices
- Git Integration Practices for AI Coding Tools
- AI Change Review Examples
- Stacked PR for AI-Generated Changes
- Git Troubleshooting Playbook
- Team Git Workflow Guide
- GitHub Engineering Governance Manual
- Enterprise Engineering Practice Case Library
- Decision Map for Enterprise Engineering Practices
- AI Code Review Checklist
Recommended Resources
New content will prioritize official documentation and industry-standard materials:
- Pro Git
- Git Official Documentation
- GitHub Docs
- Atlassian Git tutorials
- Trunk Based Development
- Git Flight Rules
For a more complete index of materials, see Recommended Reading.
Versions and Maintenance Plan
See the roadmap for detailed plans.
The course, repairs, and collaboration material are collected in the v2.2.0 release notes and Changelog. The documentation was prepared on 2026-09-09; GitHub Releases records publication status.
Existing content will be gradually incorporated into new learning paths. See the legacy content migration for the migration list and the resources index for the materials index.
Project Governance
Original project content is licensed under the MIT License. Third-party materials, archived ebooks, external articles, linked resources, and quoted references remain under their original licenses and copyrights.
Contributing
We welcome contributions of real-world problems, team practices, incident recovery experiences, AI programming workflows, and reusable templates.
Please follow the Content Style Guide for new content.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,941 starspublic-apis/public-apis
A collective list of free APIs
497,204 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
442,648 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,182 stars