Syncing Documents
Push your ArchDoc documents to GitHub
Syncing Documents to GitHub
Once GitHub is connected and a repository is selected, you can sync documents to keep them in version control.
Prerequisites
- ✅ GitHub connected
- ✅ Repository selected
- ✅ Document ready to sync
How to Sync a Document
Manual Sync
- Navigate to Dashboard > Documents and open the document you want to sync
- Find the GitHub card in the sidebar
- Click Sync to GitHub
- The button shows a spinner while in flight, and a success toast appears when the commit is created
Auto-sync on Save
You can opt a document into automatic syncing on every save:
- Open the document and find the GitHub card in the sidebar
- Toggle Auto-sync on save on
- Every successful save now also pushes a commit to GitHub silently
The toggle is per-document and only appears when a repository is configured for the company. Auto-sync is silent — it doesn't show a toast on no-op commits — so it doesn't get in the way while you're iterating. The manual Sync button still works at any time.
Confirmation
After a sync, the GitHub sidebar card always shows:
- A status row (Synced X ago or Never synced)
- A View file link to the file in your repository
- A scrollable list of recent linked PRs and commits (fixed height — the card no longer grows after repeated syncs)
What Gets Synced
Document Content
Your document is converted to a Markdown file with YAML front matter:
---
title: Use PostgreSQL for Database
type: ADR
category: ACCEPTED
author: John Doe
created: 2026-02-15
updated: 2026-02-17
---
# Use PostgreSQL for Database
## Context
...
## Decision
...
## Consequences
...The HTML → Markdown conversion uses turndown with the GitHub-Flavored Markdown plugin, so tables, task lists, nested lists, strikethrough, and images with width/height all round-trip cleanly.
Diagrams
Diagrams render natively on GitHub:
| Diagram type | How it's synced |
|---|---|
| Mermaid | Emitted as a ```mermaid fenced code block — GitHub renders these natively |
| Draw.io | Exported SVG is committed as a sibling asset (e.g. docs/adr/<slug>-drawio-1.svg) and the block is replaced with a Markdown image reference. Falls back to an ```xml mxfile fence when no SVG payload is available. |
| Excalidraw | Pre-rendered to SVG in the browser, posted alongside the sync request, and committed as a sibling asset, then referenced as a Markdown image. |
The Markdown file and every generated SVG are written in a single atomic commit via the GitHub Git Data API (blob → tree → commit → ref). Reviewers always see the prose change and the diagrams change together — no half-applied syncs.
Metadata (Frontmatter)
| Field | Description |
|---|---|
| title | Document title |
| type | ADR, RFC, or DESIGN_DOC |
| category | IN_PROGRESS, ACCEPTED, or CLOSED |
| author | Document creator |
| created | Creation date |
| updated | Last update date |
File Location
Documents are synced to paths based on type:
| Type | Path |
|---|---|
| ADR | docs/adr/[slug].md |
| RFC | docs/rfc/[slug].md |
| Design Doc | docs/design-doc/[slug].md |
Sync Behavior
First Sync
- Creates the file in the repository
- Creates directories if needed
- Commits with a descriptive message
Subsequent Syncs
- Updates the existing file
- Creates a new commit
- Shows the changes in Git history
Commit Messages
ArchDoc creates descriptive commit messages:
docs: Add ADR - Use PostgreSQL for Database
Synced from ArchDoc by john.doe@company.comWhen to Sync
Manual vs. Auto-sync
Most teams use a mix:
- Manual sync for milestone commits — after major edits, when a document is finalized, or before a release. Gives you control over when each commit is created.
- Auto-sync on save for living documents that should always mirror what's in ArchDoc. Toggle it on per-document so save-driven commits flow continuously to GitHub.
Recommended Workflow
- Draft in ArchDoc (frequent saves)
- Review with sign-offs
- Sync when accepted — or enable Auto-sync on save if the document should always be mirrored
- Update and re-sync as needed
Viewing Synced Documents
In GitHub
After syncing, find your document:
- Go to your GitHub repository
- Navigate to the
docs/directory - Find the file by type and slug
- View the rendered Markdown
In ArchDoc
The document shows:
- Last sync status
- Link to GitHub file
- Sync button for updates
Linked PRs and Commits
When you sync documents, ArchDoc can track:
Linked Pull Requests
- Documents can be associated with PRs
- Shows PR status (open, merged, closed)
- Quick links to GitHub
Linked Commits
- Track which commits relate to the document
- View commit history
- Link implementation to documentation
Syncing Best Practices
Sync Accepted Documents
Focus on syncing finalized documents:
- Drafts change frequently
- Accepted documents are stable
- Reduces noise in Git history
Regular Updates
When documents change:
- Update in ArchDoc
- Sync to GitHub
- Maintains consistency
Don't Edit in Both Places
Avoid editing in both ArchDoc and GitHub:
- ArchDoc is the source of truth
- Edits in GitHub won't sync back
- Conflicts may arise
Review Before Syncing
Ensure the document is ready:
- Proofread content
- Check formatting
- Verify accuracy
Troubleshooting
Sync Failed
Common causes:
- GitHub connection expired
- Repository access revoked
- Network issues
Solutions:
- Check GitHub integration status
- Reconnect if needed
- Try again later
File Not Appearing in GitHub
Check:
- Sync completed successfully
- Looking in the correct path
- Repository is correct
Permission Denied
Causes:
- Lost write access to repo
- Repository deleted or moved
- OAuth token expired
Solutions:
- Verify repository access
- Reconnect GitHub integration
- Select a different repository
Content Not Updated
If changes aren't appearing:
- Ensure you saved in ArchDoc
- Click sync again
- Check the commit in GitHub
Sync vs. Export
| Feature | Sync to GitHub | Export |
|---|---|---|
| Destination | GitHub repo | Your computer |
| Version control | ✅ | ❌ |
| Collaboration | ✅ | ❌ |
| One-time | ❌ Persistent | ✅ |
| Format | Markdown | Markdown/PDF |
Security Notes
What's Shared
Only document content and metadata go to GitHub:
- ✅ Document text
- ✅ Basic metadata
- ❌ Sign-offs (stay in ArchDoc)
- ❌ Comments (stay in ArchDoc)
- ❌ User details beyond author
Repository Privacy
Your repository's visibility controls access:
- Private repo: Only collaborators see docs
- Public repo: Anyone can see docs
Choose visibility appropriate for your documentation.