CLI
ploy git & ploy push
Push to a project's Ploy Git repository from the command line.
ploy git and ploy push
These commands work with projects that deploy from Ploy Git. They need you to be logged in (ploy auth login) or an API token in PLOY_API_TOKEN.
Choosing the project
Every command resolves the project in this order:
- The
--project <id>flag - The
PLOY_PROJECT_IDenvironment variable - The
projectkey inploy.yaml
Run ploy api project list to find project IDs. Projects that deploy from GitHub are refused; push to GitHub instead.
ploy push
Pushes a branch to the project's repository with a one-off URL. Nothing is stored in your git config.
ploy push [ref] [options]| Option | Description |
|---|---|
[ref] | Local branch or ref to push (default: current) |
--project <id> | Project ID |
--ttl <duration> | Lifetime of the push URL (default 1h) |
--remote-branch <name> | Branch name in the Ploy Git repository |
--force | Force-push, using --force-with-lease for safety |
ploy push
ploy push main --project proj123
ploy push feature/login --remote-branch previewploy git remote
Mints a git remote URL for the project. Use --add to configure a remote you can push to with plain git.
ploy git remote [options]| Option | Description |
|---|---|
--project <id> | Project ID |
--ttl <duration> | How long the URL stays valid, e.g. 1h, 24h, 30d |
--add | Add the remote, or update it if it already exists |
--set-url | Update an existing remote |
--name <remote> | Remote name (default ploy) |
--read-only | Mint a URL that can only fetch |
--json | Print the full URL as JSON |
ploy git remote --add --ttl 30d
git push -u ploy mainThe URL contains a credential. The CLI hides it unless you pass --json.
Repositories and projects
# List an organization's Ploy Git repositories
ploy api repository list --org org123
# Create a repository
ploy api repository create my-app --org org123 --default-branch main
# Mint a remote URL for a repository
ploy api repository remote-url repo123 --ttl 24h --json
# Create a project with a new Ploy Git repository
ploy api project create my-app --source ploy --org org123
# Create a project from an existing Ploy Git repository
ploy api project create --source ploy --repository-id repo123 --org org123How is this guide?
Last updated on