Overview
T3 Code provides deep Git integration, allowing you to commit changes, create branches, manage worktrees, and create pull requests directly from the interface. The AI works within your Git workflow, respecting your branching strategy and providing tools for safe experimentation.Git Status
Real-Time Updates
The interface shows live Git status for each thread:- Current Branch: Displayed in thread metadata and toolbar
- PR Status: Badge shows if thread has an open/merged/closed PR
- Uncommitted Changes: Indicated in the Git actions menu
Status Information
Git status includes:Committing Changes
From the Toolbar
Commit Message Tips
feat:- New featurefix:- Bug fixrefactor:- Code restructuringdocs:- Documentationtest:- Testschore:- Maintenance
Branching Strategy
Local Development
When working locally (non-worktree threads):- AI makes changes in your current branch
- You commit when ready
- Create new branch manually if needed
- Continue conversation in new branch context
Worktree Threads
Worktree threads create isolated environments:- Automatic Branching
- Manual Branch
When creating a worktree thread:
- T3 creates a new branch (
t3code/abc123) - Branch is based on current HEAD
- Changes are isolated from main workspace
- Worktree path:
.t3-worktrees/thread-id/
Branch Naming
T3 Code uses these conventions:- Temporary:
t3code/8hex- Auto-generated for ephemeral work - Feature:
feature/your-name- User-specified feature branches - Main branches:
main,master,develop- Never auto-created
Temporary branches starting with
t3code/ are detected and can be cleaned up automatically.Git Worktrees
What Are Worktrees?
Git worktrees let you work on multiple branches simultaneously. Each worktree is a separate directory with its own checked-out branch. Benefits:- ✅ Isolated changes per thread
- ✅ No branch switching in main workspace
- ✅ Safe experimentation
- ✅ Parallel development
- ⚠️ Additional disk space per worktree
- ⚠️ Need to manage cleanup
- ⚠️ Can be confusing for Git beginners
Creating Worktree Threads
Worktree location:
Worktree Lifecycle
When deleting a thread with a worktree:- T3 detects the worktree is orphaned (no other threads use it)
- Prompts to delete the worktree directory
- Optionally removes the Git worktree registration
Manual Worktree Management
List worktrees:Creating Pull Requests
From the Toolbar
PR Title and Description
T3 Code automatically generates PR metadata: Title: Based on most recent commit or conversation contextGitHub CLI Setup
T3 Code usesgh CLI for PR creation:
- Install
- Authenticate
- Verify
PR Status Tracking
Once created, the PR is tracked in the thread:- Badge: Shows PR number and state (open/closed/merged)
- Link: Click badge to open PR in browser
- Updates: Status refreshes automatically
Stacked Actions
T3 Code supports Git stacked workflows for incremental changes:Commit and Push
- Stages all changes
- Commits with your message
- Pushes to remote branch
Commit and Create PR
- Stages all changes
- Commits with your message
- Pushes to remote
- Creates PR using
ghCLI
Advanced Git Operations
Reverting Changes
T3 Code provides checkpoint-based revert:Viewing Diffs
Inline Diffs
Each conversation turn shows change summaries:Diff Panel
Open the side-by-side diff panel:- Unified diff format
- Syntax highlighting
- Per-turn filtering
- Full file content
Comparing Branches
Use Git commands in the terminal:Git Configuration
Repository Setup
Ensure your repository is configured:Gitignore
Add T3 Code directories to.gitignore:
Hooks
Git hooks work normally with T3 Code:- pre-commit: Runs before commits from toolbar
- commit-msg: Can validate commit messages
- pre-push: Runs before push operations
.git/hooks/ or use a tool like Husky.
Workflows by Team Size
Solo Developer
- Local threads for small changes
- Worktree threads for features
- Commit after each working state
Small Team (2-5)
- Always use worktree threads
- Create PRs for all features
- Review before merging
Large Team (6+)
- Worktree threads mandatory
- Branch naming convention
- Protected main branch
- Automated testing
Troubleshooting
”Not a Git repository”
If Git features are disabled:- Run
git initin project root - Refresh the page
- Verify
.gitdirectory exists
Worktree Creation Failed
Common causes:- Branch exists: Choose different branch name
- Disk space: Free up space for worktree
- Permissions: Ensure write access to project directory
PR Creation Failed
Check:ghCLI is installed and authenticated- Remote repository is set
- Branch is pushed to remote
- GitHub access token has permissions
Merge Conflicts
If AI changes conflict with other commits:- Pull latest changes:
git pull - Resolve conflicts manually
- Commit resolution
- Continue conversation
Best Practices
Git Workflow Tips
- Commit often: Save progress incrementally
- Descriptive messages: Future you will thank present you
- Use worktrees: Isolate experimental work
- Review diffs: Always check changes before committing
- Clean up branches: Delete merged feature branches
Commit Frequency
- ✅ After each logical change
- ✅ Before switching context
- ✅ When conversation reaches milestone
- ❌ Don’t commit broken code
- ❌ Don’t commit half-finished features (unless WIP marked)
Branch Naming
Next Steps
- Explore Web Interface for daily use
- Configure CLI Usage for automation
- Organize work with Project Management
