# deepakzest/mygit architecture

> Architecture diagram of the GitHub repository deepakzest/mygit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deepakzest/mygit
- Repository: https://github.com/deepakzest/mygit

## Overview

This is a small C++ command-line version-control project. Its main workflow dispatches user commands through the CLI to repository operations: initialize metadata, stage selected or all working files, commit staged content, revert to a commit, and print history. The commit-list implementation also persists commit metadata and snapshots under .git/commits. The excerpts show the main call chain and filesystem responsibilities; finer commit traversal details are only partially sampled, so the graph avoids asserting their internal sequencing.

Main entry points: [`gitClass.cpp`](https://github.com/deepakzest/mygit/blob/main/gitClass.cpp) (Repository operations), [`main.cpp`](https://github.com/deepakzest/mygit/blob/main/main.cpp) (Command dispatch), [`commitNodeList.cpp`](https://github.com/deepakzest/mygit/blob/main/commitNodeList.cpp) (Commit list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command interface"]
  node_commands["Command dispatch<br/>[main.cpp]"]
end

subgraph group_repo["Repository operations"]
  node_repository_ops["Repository operations<br/>[gitClass.cpp]"]
  node_staging[("Staging area<br/>[gitClass.cpp]")]
end

subgraph group_history["Commit history"]
  node_commit_list["Commit list<br/>[commitNodeList.cpp]"]
  node_commit_store[("Commit snapshots<br/>[commitNodeList.cpp]")]
end

node_user(("CLI user"))

node_user -->|"runs commands"| node_commands
node_commands -->|"dispatches operations"| node_repository_ops
node_repository_ops -->|"copies files"| node_staging
node_repository_ops -->|"delegates commit actions"| node_commit_list
node_commit_list -->|"reads and writes"| node_commit_store

click node_commands "https://github.com/deepakzest/mygit/blob/main/main.cpp"
click node_repository_ops "https://github.com/deepakzest/mygit/blob/main/gitClass.cpp"
click node_staging "https://github.com/deepakzest/mygit/blob/main/gitClass.cpp"
click node_commit_list "https://github.com/deepakzest/mygit/blob/main/commitNodeList.cpp"
click node_commit_store "https://github.com/deepakzest/mygit/blob/main/commitNodeList.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_commands,node_user toneBlue
class node_repository_ops,node_staging toneAmber
class node_commit_list,node_commit_store toneMint
```

## Components

### Command interface

- [Command dispatch](https://github.com/deepakzest/mygit/blob/main/main.cpp): `main.cpp`

### Repository operations

- [Repository operations](https://github.com/deepakzest/mygit/blob/main/gitClass.cpp): `gitClass.cpp`
- [Staging area](https://github.com/deepakzest/mygit/blob/main/gitClass.cpp): `gitClass.cpp`

### Commit history

- [Commit list](https://github.com/deepakzest/mygit/blob/main/commitNodeList.cpp): `commitNodeList.cpp`
- [Commit snapshots](https://github.com/deepakzest/mygit/blob/main/commitNodeList.cpp): `commitNodeList.cpp`

### Other components

- **CLI user**

## Connections

- CLI user → Command dispatch: runs commands (evidence: `main.cpp`)
- Command dispatch → Repository operations: dispatches operations (evidence: `main.cpp`)
- Repository operations → Staging area: copies files (evidence: `gitClass.cpp`)
- Repository operations → Commit list: delegates commit actions (evidence: `gitClass.cpp`)
- Commit list → Commit snapshots: reads and writes (evidence: `commitNodeList.cpp`)
