Skip to content

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:

Terminal window
# Update main
git checkout main
git pull
# Sync your stack
rung sync
# Check status
rung status

If there are conflicts, see Conflict Resolution.

Starting a New Feature

1. Start from main

Terminal window
git checkout main
git pull

2. Create your first branch

Terminal window
rung create -m "feat: add user model"

Make your changes, then continue building the stack.

3. Stack dependent changes

Terminal window
# Make changes to your code
# ...
# Create the next branch
rung create -m "feat: add user API endpoints"
# Continue working
# ...
rung create -m "feat: add user validation"

4. Check your progress

Terminal window
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 ● conflict

Submitting for Review

When you’re ready for review:

Terminal window
rung submit

This pushes all branches and creates PRs with correct base branches.

Draft PRs

If you want feedback before the PR is “ready”:

Terminal window
rung submit --draft

Custom PR Titles

Override the commit-derived title for any branch:

Terminal window
git checkout feat-add-user-model
rung submit --title "Add User model with validation"

During Review

Addressing Feedback

When reviewers request changes:

Terminal window
# Navigate to the branch that needs changes
rung move # Interactive picker
# or
git checkout feat-add-user-api-endpoints
# Make your changes
git add .
git commit -m "Address review feedback"
# Push the update
rung submit

Updating After Main Changes

If main moves forward while you’re in review:

Terminal window
git checkout main
git pull
rung sync
rung submit # Push the rebased branches

Merging

Always merge from the bottom of the stack (closest to main):

Terminal window
# Go to the bottom branch
rung prv
rung prv # Repeat until you're at the first branch
# Merge it
rung merge

Rung automatically:

  • Merges the PR via GitHub
  • Rebases child branches
  • Updates child PR base branches
  • Removes the merged branch

Continue Merging

After the first merge:

Terminal window
# You're now on the next branch
rung merge # Merge this one too
# Repeat as PRs are approved

Quick Navigation

Terminal window
rung nxt # Go to child branch
rung prv # Go to parent branch
rung move # Interactive picker

See What’s in a Branch

Terminal window
rung log # Commits in current branch

Common Patterns

Pattern 1: Feature + Tests

Terminal window
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

Terminal window
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

Terminal window
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:

Terminal window
# Stack 1
git checkout main
rung create -m "feat: user authentication"
rung create -m "feat: user sessions"
# Stack 2 (start fresh from main)
git checkout main
rung 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:

Terminal window
# Make sure everything is pushed
rung submit
# Check status
rung status

Your stack is safely on GitHub, ready for tomorrow.

Quick Reference

TaskCommand
Start new stackgit checkout main && rung create -m "..."
Add to stackrung create -m "..."
Check statusrung status
Sync with maingit checkout main && git pull && rung sync
Submit PRsrung submit
Merge bottom PRrung prv (repeat) then rung merge
Navigaterung nxt, rung prv, rung move

Next Steps