Skip to main content
The +ephemeral namespace stores refs separately from the default namespace. Use it for previews, CI artifacts, and other isolated work. Insert +ephemeral before .git in the repository URL:
Two rules apply to every ref that you write through this URL:
  • A normal git clone does not show the ref. Code Storage puts the ref in the ephemeral namespace. The normal repository URL hides that namespace.
  • A connected GitHub repository does not receive the ref. Code Storage never mirrors an ephemeral ref to an upstream host.
An ephemeral branch gives you isolation inside one repository. It shares the Git objects and access rules. It remains until you delete or promote it. Promote an ephemeral branch when you want it in the default namespace. Use a fork when you need separate repository access. The other namespace, Import Namespace, accepts a push only and follows different rules.

Setup

Add a named remote when you use the namespace often:
This remote accepts standard Git commands.

Quick start

Push and pull ephemeral branches with standard Git commands:

Promote a branch

Fetch an ephemeral branch. Then push it to the main remote.

Behavior

  • Base: Name a base for each ephemeral branch. Use baseBranch / baseRef in the API. When you work with Git, clone the normal remote as your base. The ephemeral remote has no default branch.
  • Isolation: An ephemeral branch can have the same name as a branch in the default namespace. The two branches remain separate until promotion.
  • Shared objects: Ephemeral branches reuse Git objects that are already in the repository. This reduces storage use.
  • HTTP API and Git: Git operations work as usual. HTTP API methods can read and write ephemeral refs when they accept ephemeral or ephemeral_base.

SDK examples

Create an ephemeral branch

In the Python SDK, set ephemeral=True in calls that create commits, read files, or list files. In TypeScript, set ephemeral: true.

Branch from an ephemeral base

Mark the base as ephemeral when another ephemeral branch is the base. You must also set the base branch.

Promote an ephemeral branch

Promote an ephemeral branch to the default namespace. Keep the same branch name or use a new name.
This operation keeps the ephemeral branch. Delete that branch when you no longer need it.