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
| Option | Description | Default |
|---|---|---|
-w, --worktree <name> | Worktree to stop | Main project deployment |
-p, --project <name> | Project name | Auto-detected from current directory |
-y, --yes | Skip confirmation prompts | false |
--delete-cluster | Delete k8s cluster (only when specified) | false |
--delete-registry | Delete the local image registry/cache (data will be lost) | false |
--all-projects | Stop all projects | false |
--all-worktrees | Stop all worktrees in current project | false |
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 deleteto 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
- gws up - Start worktrees
- gws delete - Permanently delete worktrees
- gws status - Check worktree status
- gws cluster down - Tear down the cluster itself (env-scoped)