Skip to main content

gws down

Stop running worktrees and clean up resources.

Usage

gws down [options]

Output:

Stopping worktree 'feature-auth'...

✓ Stopped file sync watchers
✓ Terminated port-forward processes
✓ Deleted namespace: myapp-feature-auth
✓ Removed from state

Worktree 'feature-auth' stopped successfully!

Note: This command can be run from anywhere using the -p [project] option.


Options

OptionDescriptionDefault
-w, --worktree <name>Worktree to stopMain project deployment
-p, --project <name>Project nameAuto-detected from current directory
-y, --yesSkip confirmation promptsfalse
--delete-clusterDelete k8s cluster (only when specified)false
--delete-registryDelete the local image registry/cache (data will be lost)false
--all-projectsStop all projectsfalse
--all-worktreesStop all worktrees in current projectfalse

Examples:

# Stop specific worktree
gws down -w feature-auth

# Stop all worktrees
gws down

# Stop and delete cluster
gws down --delete-cluster

# Skip confirmation
gws down -y

Multirepo Behavior

When running gws down in a multirepo setup, the command stops all services that were deployed together from each repository.

Project Structure

myapp/                          # Parent directory
├── .worktrees/ # Shared worktrees folder (at parent level)
│ └── feature-auth/ # Worktree (deployed)
│ ├── api/ # Worktree for api repo
│ │ └── src/
│ └── app/ # Worktree for app repo
│ └── src/
├── api/ # Git repo 1
│ ├── .git/
│ └── src/
└── app/ # Git repo 2
├── .git/
└── src/

Stopping Main Workspace

cd myapp
gws down
# or from any directory
gws down -p myapp

Stopping Worktree

cd myapp
gws down -w feature-auth
# or run from any directory
gws down -w feature-auth -p myapp

Key Points:

  • All services from all repos are stopped together (same namespace)
  • Worktree directories remain intact (only deployment is stopped)
  • Use gws delete to remove worktree directories

Typical Workflow

# Work on a feature
gws fork feature-payment
gws up -w feature-payment

# ... do your work ...

# Stop when done for the day
gws down -w feature-payment

# Delete when feature is merged
gws delete -w feature-payment

See Also