Repositories
Create and manage Git repositories for versioned storage of workflows, prompts, agents, and configurations.
Overview
Repositories in M3 Forge are Gitea-hosted Git repositories accessed through an integrated browser and code editor. They provide version control for all AI artifacts with full Git capabilities including branching, committing, merging, and history tracking.
Creating a Repository
Navigate to Repository Management
From the main navigation, go to Manage → Repositories.
Click New Repository
Select Create Repository and provide:
- Repository Name — Short identifier (e.g.,
fraud-detection-workflows) - Description — Brief summary of repository contents
- Visibility — Public or Private (controls team access)
- Initialize with README — Optional starter file
Confirm Creation
M3 Forge creates a new Gitea repository and displays the repository browser.
Repository names must be lowercase alphanumeric with hyphens. No spaces or special characters.
Repository Browser
The integrated repository browser provides a file tree interface for navigating repository contents.
File Tree
The left sidebar shows the repository structure:
- Directories expand/collapse to reveal contents
- Files display with icons based on type (JSON, YAML, etc.)
- Current branch displayed at the top
- Commit count shows total commits
Click any file to open it in the code editor.

Code Editor
The built-in code editor supports:
- Syntax highlighting for JSON, YAML, JavaScript, Python, Markdown
- Line numbers for easy reference
- Search and replace within file
- Multi-file editing via tabs
- Auto-save option to prevent lost work
Edit files directly in the browser without cloning the repository locally.
Committing Changes
After editing files, commit your changes to the repository:
Stage Changes
Modified files appear in the Changes panel. Select files to stage for commit.
Write Commit Message
Provide a descriptive commit message following conventions:
- First line — Brief summary (50 chars or less)
- Blank line
- Body — Detailed explanation of why the change was made (optional)
Example:
Add fraud detection workflow
Implements real-time transaction analysis with rule-based
and ML-based fraud scoring. Includes HITL review step for
high-risk transactions.Commit
Click Commit to create a snapshot of staged changes. The commit appears in the history immediately.
Commit messages are permanent and visible in audit logs. Write clear, professional descriptions.
Branching
Branches enable isolated development without affecting the main codebase.
Create a Branch
From the branch dropdown:
- Click New Branch
- Enter branch name (e.g.,
feature/add-rag-pipeline) - Select base branch (usually
main) - Click Create
The new branch is immediately active in the editor.
Branch Naming Conventions
| Prefix | Use Case | Example |
|---|---|---|
feature/ | New functionality | feature/multi-language-prompts |
fix/ | Bug fixes | fix/workflow-timeout-handling |
experiment/ | Exploratory work | experiment/llama-3-prompts |
release/ | Release preparation | release/v2.1.0 |
Switch Branches
Use the branch dropdown to switch between branches. Uncommitted changes will be lost unless committed first.
Delete a Branch
After merging, delete feature branches to keep the repository clean:
- Switch to a different branch
- Open branch dropdown
- Click delete icon next to branch name
- Confirm deletion
Deleting a merged branch does not delete its commits — they remain in the main branch history.
Viewing History
The History tab shows all commits in reverse chronological order.
Commit List
Each commit displays:
- Commit message — First line of commit description
- Author — Who made the change
- Timestamp — When the commit was created
- Commit hash — Short SHA identifier
Click any commit to view its diff.
Commit Diff
The diff view shows:
- Changed files — List of modified, added, deleted files
- Line-by-line changes — Side-by-side or unified diff
- Green lines — Additions
- Red lines — Deletions
Use this to review exactly what changed in each commit.
File Operations
The repository browser supports standard file operations:
Create File
- Right-click directory in file tree
- Select New File
- Enter filename with extension
- Click Create
The new file opens in the editor.
Upload File
Drag and drop files from your desktop into the file tree, or use the Upload button.
Supported formats:
- JSON (workflows, query plans, configurations)
- YAML (prompts, agents)
- Markdown (documentation)
- Any text-based format
Rename File
- Right-click file
- Select Rename
- Enter new name
- Commit the change
Git tracks renames as a delete + add operation.
Delete File
- Right-click file
- Select Delete
- Confirm deletion
- Commit the change
Deleted files remain in Git history and can be recovered from previous commits.
Repository Settings
Access repository settings via the Settings button:
General
- Repository name — Read-only after creation
- Description — Update anytime
- Visibility — Change between public and private
- Default branch — Set which branch is primary (usually
main)
Collaborators
Add team members with specific permissions:
- Read — View files and history only
- Write — Commit changes and create branches
- Admin — Full repository access including settings
Webhooks
Configure webhooks to trigger external systems on repository events:
- Push events — Notify on new commits
- Pull request events — Notify on PR creation/merge
- Tag events — Notify on version tags
Useful for CI/CD integration and automated deployment triggers.
Working with Workflows
Workflows are stored as JSON files in the repository. The repository browser provides specialized handling:
Import Workflow from Repository
From the Workflows page:
- Click Import from Repository
- Select repository and branch
- Choose workflow JSON file
- Click Import
The workflow is loaded into the visual editor.
Export Workflow to Repository
From the workflow editor:
- Click Save to Repository
- Select target repository and branch
- Enter commit message
- Click Commit
The workflow DAG JSON is written to the repository and committed.
Workflows can be edited either in the visual editor or directly as JSON in the repository. Changes sync in both directions.
Working with Prompts
Prompts are stored as YAML files with frontmatter metadata.
Prompt File Format
---
name: "Extract Invoice Data"
model: "gpt-4o"
temperature: 0.0
max_tokens: 2000
---
Extract structured data from the following invoice:
{{ invoice_text }}
Return JSON with these fields:
- invoice_number
- date
- vendor
- total_amount
- line_items (array)Edit Prompts in Repository
Navigate to prompts/<name>.yaml and edit directly in the code editor. Commit changes to version the prompt.
Import from Prompt Repository
From the Prompts page:
- Click Import from Repository
- Select repository containing prompt YAML
- Choose prompt file
- Click Import
The prompt loads into the prompt editor for testing and refinement.
Best Practices
Commit Often
Create small, focused commits rather than large batch commits. Benefits:
- Easier review — Reviewers can understand each change quickly
- Better history — Clear progression of work
- Simpler rollback — Undo specific changes without losing unrelated work
Write Descriptive Messages
Commit messages should explain why a change was made, not just what changed. The diff already shows what changed.
Poor:
Update workflowGood:
Add retry logic to API call node
Prevents workflow failures when external API returns transient
errors. Implements exponential backoff with max 3 retries.Use Branches for Features
Never commit experimental or unfinished work directly to main. Use feature branches:
- Create branch for feature
- Commit changes iteratively
- Open pull request when ready
- Merge after review
This keeps main stable and deployable at all times.
Tag Releases
When deploying to production, create a Git tag marking the release:
v1.2.0Tags provide named snapshots that can be referenced later for rollback or audit purposes.
Integration with Release Pipeline
The Release Pipeline uses repository commits as the foundation for versioning:
- Commit changes to a branch
- Create pull request for review
- Merge to main after approval
- Create version from merged commits
- Deploy version to target environment
See Releases and Environments for the complete deployment workflow.
Troubleshooting
Changes Not Appearing
Cause: Uncommitted changes are not persisted.
Solution: Always commit changes before closing the editor or switching branches.
Merge Conflicts
Cause: Two branches modified the same lines of a file.
Solution: Resolve conflicts manually in the code editor, then commit the resolution.
Lost Commits
Cause: Committed to wrong branch or deleted branch before merging.
Solution: Use Git reflog in Gitea UI to find lost commits. Contact administrator if needed.
Permission Denied
Cause: User lacks write access to repository.
Solution: Repository admin must grant write permissions via Settings → Collaborators.
Next Steps
- Create your first pull request
- Learn about change sets
- Set up Gitea integration
- Integrate with Release Pipeline