gb push
Push local code changes to a Genbox environment.
Synopsis
gb push [name] [options]Description
Syncs local code changes to your remote Genbox environment. Uses rsync for efficient incremental transfers.
Arguments
| Argument | Description |
|---|---|
name | Optional. Environment name. |
Options
| Option | Description |
|---|---|
--app <name> | Push specific app only |
--restart | Restart services after push |
--dry-run | Show what would be pushed |
-w, --watch | Watch for changes and auto-push |
Examples
Push All Changes
gb push feature-authPush Specific App
# Push only API changes
gb push feature-auth --app apiPush and Restart
# Push and restart affected services
gb push feature-auth --restartPreview Changes
# See what would be pushed
gb push feature-auth --dry-runWatch Mode
# Auto-push on file changes
gb push feature-auth --watchWhat Gets Pushed
- Source files (
src/,lib/, etc.) - Configuration files
- Static assets
What’s Excluded
node_modules/.git/- Build outputs (
dist/,.next/) - Environment files (
.env*) - Large binary files
Workflow
- Detection: Identifies changed files
- Transfer: Syncs changes via rsync over SSH
- Hot Reload: Many frameworks auto-reload
- Restart: Optional service restart
Watch Mode
Watch mode monitors for file changes:
Watching for changes...
[12:34:56] Changed: src/api/users.ts
[12:34:56] Pushing 1 file...
[12:34:57] Done (0.3s)
[12:35:10] Changed: src/api/auth.ts, src/api/middleware.ts
[12:35:10] Pushing 2 files...
[12:35:11] Done (0.4s)Notes
- First push may be slower (full sync)
- Subsequent pushes are incremental
- Hot reload works for most frameworks
- Use
--restartif changes aren’t picked up
See Also
gb connect- SSH for manual syncgb restart- Restart servicesgb rebuild- Full rebuild
Last updated on