English | 中文
A practical Git/GitHub handbook for modern engineering teams and AI-native development workflows.
This repository started as a collection of Git learning materials and has helped many Chinese developers get started with Git.
Today, a link collection is no longer enough. The core challenges of Git have expanded from "how to use commands" to more practical questions:
- How individual developers understand Git's mental model.
- How to handle conflicts, rollbacks, and accidental commits in daily development.
- How teams choose the right branch and PR workflows.
- How engineering leads establish collaboration standards using GitHub.
- How to review, split, verify, and revert AI-generated code changes in AI-native development workflows.
Therefore, v2.0 upgrades this repository into:
A practical Git/GitHub handbook for modern engineering teams and AI-native development workflows.
- 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 | Problems Solved |
|---|---|
| 01-getting-started | Git basics, mental models, and the difference between Git and SVN |
| 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 |
- Team Git Workflow Guide
- GitLab Flow
- Pull Request Best Practices
- Code Review Best Practices
- GitHub Flow
- Trunk-Based Development
- Gitflow
- GitHub Engineering Governance Manual
- Enterprise GitHub Workflow Stack
- Branch Protection
- Rulesets
- Merge Queue
- GitOps and Config as Code
- Release Management
- 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
| 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 |
| 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 |
- 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
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.
See the roadmap for detailed plans.
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.
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.
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.