# weiningwei/sourcegit architecture

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

- Interactive diagram: https://gitdiagram.com/weiningwei/sourcegit
- Repository: https://github.com/weiningwei/sourcegit

## Overview

SourceGit is a cross-platform Git GUI. The principal workflow is opening a repository, viewing its state and history, then invoking Git operations through the interface and inspecting the result. The README also documents dedicated capabilities for diffs and file history, collaboration, repository organization, Git LFS, and AI-assisted commit messages. The graph uses the tree and sampled code; links within unsampled feature areas are included only where the README or sampled call sites support them.

Main entry points: [`src/Commands/Command.cs`](https://github.com/weiningwei/sourcegit/blob/master/src/Commands/Command.cs) (Git command layer), [`src/ViewModels/Repository.cs`](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Repository.cs) (Repository workspace), [`src/ViewModels/Launcher.cs`](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Launcher.cs) (Repository launcher), [`src/ViewModels/WorkingCopy.cs`](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/WorkingCopy.cs) (Working copy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_app["Application entry<br/>[App.axaml.cs]"]
  node_launcher["Repository launcher<br/>[Launcher.cs]"]
  node_repository_ui["Repository workspace<br/>[Repository.cs]"]
  node_repository_view["Repository view"]
  node_working_copy["Working copy<br/>[WorkingCopy.cs]"]
end

subgraph group_gitops["Git operations"]
  node_commands["Git command layer<br/>[Command.cs]"]
  node_repository_status["Status query"]
  node_changes_query["Change query"]
  node_models["Repository models"]
end

subgraph group_features["Repository features"]
  node_history["Commit history<br/>[Histories.cs]"]
  node_diff["Diff and compare<br/>[Compare.cs]"]
  node_file_history["File history<br/>[FileHistories.cs]"]
  node_blame["File blame<br/>[Blame.cs]"]
  node_commit["Commit workflow<br/>[WorkingCopy.cs]"]
  node_gitflow["GitFlow<br/>[GitFlowStart.cs]"]
  node_workspace["Workspace management<br/>[Workspace.cs]"]
  node_custom_actions["Custom actions"]
  node_lfs["Git LFS<br/>[LFSFetch.cs]"]
  node_ai["AI commit assistant<br/>[AIAssistant.cs]"]
end

subgraph group_integrations["External integrations"]
  node_git[("Git repository")]
  node_ai_service["Compatible AI API"]
  node_remote["Git remotes"]
end

node_user(("User"))

node_user -->|"launches"| node_app
node_app -->|"opens"| node_launcher
node_user -->|"selects repository"| node_launcher
node_launcher -->|"opens"| node_repository_ui
node_repository_ui -->|"presents"| node_repository_view
node_repository_ui -->|"runs operations"| node_commands
node_working_copy -->|"runs operations"| node_commands
node_history -->|"queries history"| node_commands
node_diff -->|"queries revisions"| node_commands
node_file_history -->|"queries history"| node_commands
node_blame -->|"queries blame"| node_commands
node_gitflow -->|"runs GitFlow"| node_commands
node_lfs -->|"runs LFS"| node_commands
node_custom_actions -->|"runs actions"| node_commands
node_commands -->|"invokes Git"| node_git
node_repository_ui -->|"queries status"| node_repository_status
node_working_copy -->|"queries changes"| node_changes_query
node_repository_status -->|"returns status"| node_models
node_changes_query -->|"returns changes"| node_models
node_commands -->|"accesses remotes"| node_remote
node_ai -.->|"requests messages"| node_ai_service
node_ai -.->|"uses commit context"| node_commands
node_workspace -->|"organizes repositories"| node_repository_ui

click node_app "https://github.com/weiningwei/sourcegit/blob/master/src/App.axaml.cs"
click node_launcher "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Launcher.cs"
click node_repository_ui "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Repository.cs"
click node_repository_view "https://github.com/weiningwei/sourcegit/blob/master/src/Views/Repository.axaml.cs"
click node_working_copy "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/WorkingCopy.cs"
click node_history "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Histories.cs"
click node_diff "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Compare.cs"
click node_file_history "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/FileHistories.cs"
click node_blame "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Blame.cs"
click node_commit "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/WorkingCopy.cs"
click node_gitflow "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/GitFlowStart.cs"
click node_workspace "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Workspace.cs"
click node_custom_actions "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/ExecuteCustomAction.cs"
click node_lfs "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/LFSFetch.cs"
click node_ai "https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/AIAssistant.cs"
click node_commands "https://github.com/weiningwei/sourcegit/blob/master/src/Commands/Command.cs"
click node_repository_status "https://github.com/weiningwei/sourcegit/blob/master/src/Commands/QueryRepositoryStatus.cs"
click node_changes_query "https://github.com/weiningwei/sourcegit/blob/master/src/Commands/QueryLocalChanges.cs"
click node_models "https://github.com/weiningwei/sourcegit/blob/master/src/Models/RepositoryStatus.cs"

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_app,node_launcher,node_repository_ui,node_repository_view,node_working_copy,node_user toneBlue
class node_commands,node_repository_status,node_changes_query,node_models toneAmber
class node_history,node_diff,node_file_history,node_blame,node_commit,node_gitflow,node_workspace,node_custom_actions,node_lfs,node_ai toneMint
class node_git,node_ai_service,node_remote toneRose
```

## Components

### Desktop interface

- [Application entry](https://github.com/weiningwei/sourcegit/blob/master/src/App.axaml.cs): `src/App.axaml.cs`
- [Repository launcher](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Launcher.cs): `src/ViewModels/Launcher.cs`
- [Repository workspace](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Repository.cs): `src/ViewModels/Repository.cs`
- [Repository view](https://github.com/weiningwei/sourcegit/blob/master/src/Views/Repository.axaml.cs): `src/Views/Repository.axaml.cs`
- [Working copy](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/WorkingCopy.cs): `src/ViewModels/WorkingCopy.cs`

### Git operations

- [Git command layer](https://github.com/weiningwei/sourcegit/blob/master/src/Commands/Command.cs): `src/Commands/Command.cs`
- [Status query](https://github.com/weiningwei/sourcegit/blob/master/src/Commands/QueryRepositoryStatus.cs): `src/Commands/QueryRepositoryStatus.cs`
- [Change query](https://github.com/weiningwei/sourcegit/blob/master/src/Commands/QueryLocalChanges.cs): `src/Commands/QueryLocalChanges.cs`
- [Repository models](https://github.com/weiningwei/sourcegit/blob/master/src/Models/RepositoryStatus.cs): `src/Models/RepositoryStatus.cs`

### Repository features

- [Commit history](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Histories.cs): `src/ViewModels/Histories.cs`
- [Diff and compare](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Compare.cs): `src/ViewModels/Compare.cs`
- [File history](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/FileHistories.cs): `src/ViewModels/FileHistories.cs`
- [File blame](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Blame.cs): `src/ViewModels/Blame.cs`
- [Commit workflow](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/WorkingCopy.cs): `src/ViewModels/WorkingCopy.cs`
- [GitFlow](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/GitFlowStart.cs): `src/ViewModels/GitFlowStart.cs`
- [Workspace management](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/Workspace.cs): `src/ViewModels/Workspace.cs`
- [Custom actions](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/ExecuteCustomAction.cs): `src/ViewModels/ExecuteCustomAction.cs`
- [Git LFS](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/LFSFetch.cs): `src/ViewModels/LFSFetch.cs`
- [AI commit assistant](https://github.com/weiningwei/sourcegit/blob/master/src/ViewModels/AIAssistant.cs): `src/ViewModels/AIAssistant.cs`

### External integrations

- **Git repository**
- **Compatible AI API**
- **Git remotes**

### Other components

- **User**

## Connections

- User → Application entry: launches
- Application entry → Repository launcher: opens
- User → Repository launcher: selects repository
- Repository launcher → Repository workspace: opens
- Repository workspace → Repository view: presents
- Repository workspace → Git command layer: runs operations
- Working copy → Git command layer: runs operations
- Commit history → Git command layer: queries history
- Diff and compare → Git command layer: queries revisions
- File history → Git command layer: queries history
- File blame → Git command layer: queries blame
- GitFlow → Git command layer: runs GitFlow
- Git LFS → Git command layer: runs LFS
- Custom actions → Git command layer: runs actions
- Git command layer → Git repository: invokes Git
- Repository workspace → Status query: queries status
- Working copy → Change query: queries changes
- Status query → Repository models: returns status
- Change query → Repository models: returns changes
- Git command layer → Git remotes: accesses remotes
- AI commit assistant → Compatible AI API: requests messages
- AI commit assistant → Git command layer: uses commit context
- Workspace management → Repository workspace: organizes repositories
