E2B icon

E2B

Run commands and manage E2B sandboxes and snapshots

Git → Clone

AI-generated

Summary

Clone a Git repository into an E2B sandbox at a specified path, optionally specifying branch, commit, shallow clone depth, and authentication credentials.

Inputs

  • Sandbox ID (required) — ID of the sandbox to work with.
  • Repository URL (required) — Git repository URL to clone into the sandbox.
  • Repository Path (required) — Target path inside the sandbox where the repository will be cloned.
  • Clone Options — Optional parameters including branch to check out, commit SHA, shallow clone depth, HTTPS username, password/token, and whether to store credentials in the repository config.
  • Timeout — Timeout in seconds for the clone operation; default is 300 seconds.

Output shape

a single JSON object containing the clone operation result, including success status, exit codes, stdout/stderr output, repository path, url, and optionally checkout results if a commit is specified

If credentials are included, they are embedded temporarily in the clone URL and optionally removed after cloning unless 'Store Credentials in Repository' is enabled. The output contains detailed clone and optional checkout information.

Links

Discussion