Git Integration
Stage, commit, push, and create PRs—all optimized for mobile.
AgentOS includes a complete git workflow so you never need to leave the app. Every feature works on mobile with touch-optimized controls.
Git Panel
Open the git panel from the pane header tabs. It shows three sections:
- Staged - Files ready to commit
- Unstaged - Modified files not yet staged
- Untracked - New files not in git
The panel auto-refreshes when files change, or tap the refresh button to update manually.
Staging Files
Tap to Stage
Click the + button next to any file to stage it. Click − to unstage.
Swipe to Stage (Mobile)
On touch devices, swipe gestures make staging fast:
- Swipe right on an unstaged file to stage it
- Swipe left on a staged file to unstage it
Stage All
Click Stage All to stage all modified and untracked files at once.
Viewing Diffs
Tap any file to see its diff:
Unified View
Diffs display in unified format—perfect for narrow mobile screens:
- const oldValue = 42;
+ const newValue = 100;
Features
- Syntax highlighting - Color-coded by language
- Line numbers - Reference specific changes
- Context lines - See surrounding code
- Addition/deletion highlighting - Green for additions, red for removals
Merge Commits
AgentOS handles merge commits correctly, showing changes from both parents.
Committing
Once you've staged files:
- Enter a commit message in the text field
- Click Commit
Validation
The commit button is disabled if:
- No files are staged
- Commit message is empty
Amend
To modify the last commit, check Amend before committing. This replaces the previous commit instead of creating a new one.
Pushing
After committing, click Push to push to the remote.
New Branches
If you're on a new branch without a remote tracking branch, AgentOS sets up tracking automatically with --set-upstream.
Push Status
The UI shows when you have unpushed commits and how many.
Commit History
View recent commits in the History tab:
- Last 30 commits displayed
- Commit hash (abbreviated)
- Message and author
- Timestamp
- Files changed count
Viewing Historical Diffs
Click any commit to see:
- List of files changed in that commit
- Tap a file to see its diff at that point
This is great for reviewing what your AI agent changed.
Creating Pull Requests
AgentOS integrates with GitHub CLI (gh) for PR creation:
- Click session menu (⋮)
- Select Create PR
- Enter title and description
- Click Create
The PR is created and you get a link to view it on GitHub.
Requirements
- GitHub CLI (
gh) installed and authenticated - Remote repository on GitHub
- You're on a feature branch (not main/master)
Worktree PRs
For worktree sessions, the Create PR button appears automatically since each worktree has its own branch.
Git Worktrees
Worktrees let you work on multiple features in parallel, each with its own branch and directory.
Creating a Worktree Session
- Click + New Session
- Enable Create Worktree
- Enter a feature name (e.g., "auth-module")
- AgentOS creates:
- Branch:
feature/auth-module - Directory:
~/.agent-os/worktrees/{project}-auth-module - Copies
.env*files from main repo - Runs package manager install
- Branch:
Worktree Ports
Each worktree gets a unique dev server port:
| Worktree | Port |
|---|---|
| First | 3100 |
| Second | 3110 |
| Third | 3120 |
| ... | +10 each |
This prevents port conflicts when running multiple dev servers.
Worktree Configuration
Customize setup with .agent-os.json in your repo:
{
"setup": [
"cp $ROOT_WORKTREE_PATH/.env.local .env.local",
"pnpm install",
"npm run db:migrate"
],
"devServer": {
"command": "npm run dev",
"portEnvVar": "PORT"
}
}
Variables available:
$ROOT_WORKTREE_PATH- Path to the main repository$WORKTREE_PATH- Path to this worktree$PORT- Assigned port number
Worktree Cleanup
When you delete a worktree session, AgentOS offers to:
- Delete the worktree directory
- Delete the feature branch
Or you can keep them for later.
Mobile Git Workflow
A typical mobile git workflow:
- Review changes - Open git panel, see what's modified
- Check diffs - Tap files to see exactly what changed
- Stage selectively - Swipe to stage files you want
- Commit - Enter message and commit
- Push - Send to remote
- Create PR - Open a pull request from the menu
All without leaving AgentOS or needing a desktop.
Tips
Commit Often
Your AI agent makes many small changes. Commit frequently to:
- Create restore points
- Keep history granular
- Make PRs easier to review
Use Worktrees for Features
Instead of one long session, create worktree sessions for each feature. Benefits:
- Isolated branches
- Clean git history
- Easy to create PRs
- Can work on multiple features in parallel
Review Before Pushing
Always check the diff before pushing. AI agents occasionally make unexpected changes. The git panel makes reviewing fast and easy.