Git 基础操作手册:从入门到进阶
1. Git 数据流转模型
理解 Git 的核心在于掌握数据在不同区域间的流转。
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#4F46E5', 'primaryTextColor': '#fff', 'primaryBorderColor': '#3730A3', 'lineColor': '#6366F1', 'secondaryColor': '#10B981', 'tertiaryColor': '#F59E0B'}}}%%
flowchart LR
Workspace["工作区<br/>(Workspace)"] -->|"git add"| Index["暂存区<br/>(Index/Stage)"]
Index -->|"git commit"| Repository["本地仓库<br/>(Local Repo)"]
Repository -->|"git push"| Remote["远程仓库<br/>(Remote Repo)"]
Remote -->|"git pull/fetch"| Repository
Repository -->|"git checkout/restore"| Workspace
classDef primary fill:#4F46E5,stroke:#3730A3,color:#fff
class Workspace,Index,Repository,Remote primary