Basic Workflow
This guide covers the typical daily workflow for using rung effectively.
Starting Your Session
Start by syncing your stack with the latest changes:
# Update maingit checkout maingit pull
# Sync your stackrung sync
# Check statusrung statusIf there are conflicts, see Conflict Resolution.
Starting a New Feature
1. Start from main
git checkout maingit pull2. Create your first branch
rung create -m "feat: add user model"Make your changes, then continue building the stack.
3. Stack dependent changes
# Make changes to your code# ...
# Create the next branchrung create -m "feat: add user API endpoints"
# Continue working# ...
rung create -m "feat: add user validation"4. Check your progress
rung status Stack ────────────────────────────────────────────────── ● feat-add-user-model ← main ● feat-add-user-api-endpoints ← feat-add-user-model ● ▶ feat-add-user-validation ← feat-add-user-api-endpoints ──────────────────────────────────────────────────
● synced ● needs sync ● conflictSubmitting for Review
When you’re ready for review:
rung submitThis pushes all branches and creates PRs with correct base branches.
Draft PRs
If you want feedback before the PR is “ready”:
rung submit --draftCustom PR Titles
Override the commit-derived title for any branch:
git checkout feat-add-user-modelrung submit --title "Add User model with validation"During Review
Addressing Feedback
When reviewers request changes:
# Navigate to the branch that needs changesrung move # Interactive picker# orgit checkout feat-add-user-api-endpoints
# Make your changesgit add .git commit -m "Address review feedback"
# Push the updaterung submitUpdating After Main Changes
If main moves forward while you’re in review:
git checkout maingit pullrung syncrung submit # Push the rebased branchesMerging
Always merge from the bottom of the stack (closest to main):
# Go to the bottom branchrung prvrung prv # Repeat until you're at the first branch
# Merge itrung mergeRung automatically:
- Merges the PR via GitHub
- Rebases child branches
- Updates child PR base branches
- Removes the merged branch
Continue Merging
After the first merge:
# You're now on the next branchrung merge # Merge this one too
# Repeat as PRs are approvedNavigation Shortcuts
Quick Navigation
rung nxt # Go to child branchrung prv # Go to parent branchrung move # Interactive pickerSee What’s in a Branch
rung log # Commits in current branchCommon Patterns
Pattern 1: Feature + Tests
rung create -m "feat: add authentication"# ... implement feature ...
rung create -m "test: add auth unit tests"# ... write tests ...
rung create -m "test: add auth integration tests"Pattern 2: Refactor + Feature
rung create -m "refactor: extract user service"# ... do the refactor ...
rung create -m "feat: add user preferences"# ... implement using the refactored code ...Pattern 3: Database Migration + Code
rung create -m "chore: add users table migration"# ... add migration ...
rung create -m "feat: implement user model"# ... implement model using new table ...Working with Multiple Stacks
You can have multiple independent stacks:
# Stack 1git checkout mainrung create -m "feat: user authentication"rung create -m "feat: user sessions"
# Stack 2 (start fresh from main)git checkout mainrung create -m "feat: payment processing"rung create -m "feat: payment webhooks"Each stack is independent and can be synced/submitted separately.
End of Day
Before ending your day:
# Make sure everything is pushedrung submit
# Check statusrung statusYour stack is safely on GitHub, ready for tomorrow.
Quick Reference
| Task | Command |
|---|---|
| Start new stack | git checkout main && rung create -m "..." |
| Add to stack | rung create -m "..." |
| Check status | rung status |
| Sync with main | git checkout main && git pull && rung sync |
| Submit PRs | rung submit |
| Merge bottom PR | rung prv (repeat) then rung merge |
| Navigate | rung nxt, rung prv, rung move |
Next Steps
- Learn how to handle conflicts