Ploy
Ploy
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:

  1. The --project <id> flag
  2. The PLOY_PROJECT_ID environment variable
  3. The project key in ploy.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]
OptionDescription
[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
--forceForce-push, using --force-with-lease for safety
ploy push
ploy push main --project proj123
ploy push feature/login --remote-branch preview

ploy 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]
OptionDescription
--project <id>Project ID
--ttl <duration>How long the URL stays valid, e.g. 1h, 24h, 30d
--addAdd the remote, or update it if it already exists
--set-urlUpdate an existing remote
--name <remote>Remote name (default ploy)
--read-onlyMint a URL that can only fetch
--jsonPrint the full URL as JSON
ploy git remote --add --ttl 30d
git push -u ploy main

The 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 org123

How is this guide?

Last updated on