# t1ckpublic/gitauto architecture

> Architecture diagram of the GitHub repository t1ckpublic/gitauto, 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/t1ckpublic/gitauto
- Repository: https://github.com/t1ckpublic/gitauto

## Overview

gitAuto is a Windows-oriented C CLI that maps intent-based commands onto Git workflows; the principal path is user command → CLI dispatch → workflow command → Git repository/remote. The README documents sync, watch, repository setup, branch operations, stash/rollback, ignore management, and diagnostics. Shared configuration and Git execution support these features. Several feature sources are unsampled, so their documented capabilities are represented without asserting internal call sequences; the sampled push, branch, backup, restore, doctor, and ignore sources support the shown Git interactions.

Main entry points: [`src/gitauto.c`](https://github.com/t1ckpublic/gitauto/blob/main/src/gitauto.c) (Command dispatch), [`src/feature/common.c`](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/common.c) (Git and config helpers), [`src/feature/push.c`](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/push.c) (Smart push), [`src/feature/watch.c`](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/watch.c) (Watch and sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_cli["Command dispatch<br/>[gitauto.c]"]
end

subgraph group_workflows["Sync workflows"]
  node_push["Smart push<br/>[push.c]"]
  node_pull["Smart pull<br/>[pull.c]"]
  node_sync["Bidirectional sync<br/>[sync.c]"]
  node_watch["Watch and sync<br/>[watch.c]"]
end

subgraph group_repository["Repository operations"]
  node_init["Repository init<br/>[init.c]"]
  node_clone["Clone repository<br/>[clone.c]"]
  node_link["Bind remote<br/>[link.c]"]
  node_branches["Branch overview<br/>[branch.c]"]
  node_checkout["Branch checkout<br/>[checkout.c]"]
  node_open["Open remote<br/>[open.c]"]
end

subgraph group_state["Work state and safety"]
  node_backup["Backup snapshots<br/>[backup.c]"]
  node_save["Save work<br/>[save.c]"]
  node_restore["Restore work<br/>[restore.c]"]
  node_clean["Clean untracked<br/>[clean.c]"]
  node_undo["Undo commits<br/>[undo.c]"]
  node_reset["Reset history<br/>[reset.c]"]
  node_amend["Amend commit<br/>[amend.c]"]
  node_doctor["Repository diagnosis<br/>[doctor.c]"]
  node_ignore["Ignore rules<br/>[ignore.c]"]
end

subgraph group_shared["Shared runtime"]
  node_ssh["SSH key setup<br/>[sshagent.c]"]
  node_common["Git and config helpers<br/>[common.c]"]
  node_env["Environment helper<br/>[env.c]"]
end

node_user(("Developer"))
node_git[("Git repository and remote")]
node_browser(("Web browser"))
node_filesystem[("Working-tree files")]

node_user -->|"runs command"| node_cli
node_cli -->|"dispatches"| node_push
node_cli -->|"dispatches"| node_pull
node_cli -->|"dispatches"| node_sync
node_cli -->|"dispatches"| node_watch
node_cli -->|"dispatches"| node_init
node_cli -->|"dispatches"| node_clone
node_cli -->|"dispatches"| node_link
node_cli -->|"dispatches"| node_branches
node_cli -->|"dispatches"| node_checkout
node_cli -->|"dispatches"| node_open
node_cli -->|"dispatches"| node_backup
node_cli -->|"dispatches"| node_save
node_cli -->|"dispatches"| node_restore
node_cli -->|"dispatches"| node_clean
node_cli -->|"dispatches"| node_undo
node_cli -->|"dispatches"| node_reset
node_cli -->|"dispatches"| node_amend
node_cli -->|"dispatches"| node_doctor
node_cli -->|"dispatches"| node_ignore
node_push -->|"ensures keys"| node_ssh
node_push -->|"runs Git operations"| node_git
node_pull -->|"runs Git operations"| node_git
node_sync -->|"synchronizes"| node_git
node_watch -->|"auto-syncs"| node_git
node_watch -->|"watches changes"| node_filesystem
node_init -->|"initializes and pushes"| node_git
node_clone -->|"clones"| node_git
node_link -->|"sets remote"| node_git
node_branches -->|"fetches and inspects"| node_git
node_checkout -->|"switches branch"| node_git
node_open -->|"reads remote"| node_git
node_open -->|"opens repository"| node_browser
node_backup -->|"snapshots and restores"| node_git
node_save -->|"stashes changes"| node_git
node_restore -->|"lists or applies stash"| node_git
node_clean -->|"cleans files"| node_git
node_undo -->|"resets commits"| node_git
node_reset -->|"resets history"| node_git
node_amend -->|"amends commit"| node_git
node_doctor -->|"checks and repairs"| node_git
node_ignore -->|"edits ignore rules"| node_filesystem
node_push -->|"loads shared config"| node_common
node_branches -->|"loads shared config"| node_common
node_doctor -->|"loads shared config"| node_common
node_restore -->|"loads shared config"| node_common
node_common -->|"runs Git commands"| node_git
node_ssh -->|"sets environment"| node_env

click node_cli "https://github.com/t1ckpublic/gitauto/blob/main/src/gitauto.c"
click node_push "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/push.c"
click node_pull "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/pull.c"
click node_sync "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/sync.c"
click node_watch "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/watch.c"
click node_init "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/init.c"
click node_clone "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/clone.c"
click node_link "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/link.c"
click node_branches "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/branch.c"
click node_checkout "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/checkout.c"
click node_open "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/open.c"
click node_backup "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/backup.c"
click node_save "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/save.c"
click node_restore "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/restore.c"
click node_clean "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/clean.c"
click node_undo "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/undo.c"
click node_reset "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/reset.c"
click node_amend "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/amend.c"
click node_doctor "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/doctor.c"
click node_ignore "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/ignore.c"
click node_ssh "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/sshagent.c"
click node_common "https://github.com/t1ckpublic/gitauto/blob/main/src/feature/common.c"
click node_env "https://github.com/t1ckpublic/gitauto/blob/main/src/utils/env.c"

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_cli,node_browser toneBlue
class node_push,node_pull,node_sync,node_watch,node_git,node_filesystem toneAmber
class node_init,node_clone,node_link,node_branches,node_checkout,node_open toneMint
class node_backup,node_save,node_restore,node_clean,node_undo,node_reset,node_amend,node_doctor,node_ignore toneRose
class node_ssh,node_common,node_env,node_user toneIndigo
```

## Components

### CLI entry

- [Command dispatch](https://github.com/t1ckpublic/gitauto/blob/main/src/gitauto.c): `src/gitauto.c`

### Sync workflows

- [Smart push](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/push.c): `src/feature/push.c`
- [Smart pull](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/pull.c): `src/feature/pull.c`
- [Bidirectional sync](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/sync.c): `src/feature/sync.c`
- [Watch and sync](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/watch.c): `src/feature/watch.c`

### Repository operations

- [Repository init](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/init.c): `src/feature/init.c`
- [Clone repository](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/clone.c): `src/feature/clone.c`
- [Bind remote](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/link.c): `src/feature/link.c`
- [Branch overview](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/branch.c): `src/feature/branch.c`
- [Branch checkout](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/checkout.c): `src/feature/checkout.c`
- [Open remote](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/open.c): `src/feature/open.c`

### Work state and safety

- [Backup snapshots](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/backup.c): `src/feature/backup.c`
- [Save work](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/save.c): `src/feature/save.c`
- [Restore work](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/restore.c): `src/feature/restore.c`
- [Clean untracked](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/clean.c): `src/feature/clean.c`
- [Undo commits](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/undo.c): `src/feature/undo.c`
- [Reset history](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/reset.c): `src/feature/reset.c`
- [Amend commit](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/amend.c): `src/feature/amend.c`
- [Repository diagnosis](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/doctor.c): `src/feature/doctor.c`
- [Ignore rules](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/ignore.c): `src/feature/ignore.c`

### Shared runtime

- [SSH key setup](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/sshagent.c): `src/feature/sshagent.c`
- [Git and config helpers](https://github.com/t1ckpublic/gitauto/blob/main/src/feature/common.c): `src/feature/common.c`
- [Environment helper](https://github.com/t1ckpublic/gitauto/blob/main/src/utils/env.c): `src/utils/env.c`

### Other components

- **Developer**
- **Git repository and remote**
- **Web browser**
- **Working-tree files**

## Connections

- Developer → Command dispatch: runs command
- Command dispatch → Smart push: dispatches
- Command dispatch → Smart pull: dispatches
- Command dispatch → Bidirectional sync: dispatches
- Command dispatch → Watch and sync: dispatches
- Command dispatch → Repository init: dispatches
- Command dispatch → Clone repository: dispatches
- Command dispatch → Bind remote: dispatches
- Command dispatch → Branch overview: dispatches
- Command dispatch → Branch checkout: dispatches
- Command dispatch → Open remote: dispatches
- Command dispatch → Backup snapshots: dispatches
- Command dispatch → Save work: dispatches
- Command dispatch → Restore work: dispatches
- Command dispatch → Clean untracked: dispatches
- Command dispatch → Undo commits: dispatches
- Command dispatch → Reset history: dispatches
- Command dispatch → Amend commit: dispatches
- Command dispatch → Repository diagnosis: dispatches
- Command dispatch → Ignore rules: dispatches
- Smart push → SSH key setup: ensures keys
- Smart push → Git repository and remote: runs Git operations
- Smart pull → Git repository and remote: runs Git operations
- Bidirectional sync → Git repository and remote: synchronizes
- Watch and sync → Git repository and remote: auto-syncs
- Watch and sync → Working-tree files: watches changes
- Repository init → Git repository and remote: initializes and pushes
- Clone repository → Git repository and remote: clones
- Bind remote → Git repository and remote: sets remote
- Branch overview → Git repository and remote: fetches and inspects
- Branch checkout → Git repository and remote: switches branch
- Open remote → Git repository and remote: reads remote
- Open remote → Web browser: opens repository
- Backup snapshots → Git repository and remote: snapshots and restores
- Save work → Git repository and remote: stashes changes
- Restore work → Git repository and remote: lists or applies stash
- Clean untracked → Git repository and remote: cleans files
- Undo commits → Git repository and remote: resets commits
- Reset history → Git repository and remote: resets history
- Amend commit → Git repository and remote: amends commit
- Repository diagnosis → Git repository and remote: checks and repairs
- Ignore rules → Working-tree files: edits ignore rules
- Smart push → Git and config helpers: loads shared config
- Branch overview → Git and config helpers: loads shared config
- Repository diagnosis → Git and config helpers: loads shared config
- Restore work → Git and config helpers: loads shared config
- Git and config helpers → Git repository and remote: runs Git commands
- SSH key setup → Environment helper: sets environment
