+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:
- A normal
git clonedoes 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.
Setup
Add a named remote when you use the namespace often: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:
base_branchinrepos.commits.create, orbase_refinrepos.branches.create. 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. An operation reads an ephemeral ref when you
set its
ephemeralfield, and writes one when you settarget_is_ephemeral.base_is_ephemeralandsource_is_ephemeralread the base or the source from the ephemeral namespace.
SDK examples
Create an ephemeral branch
Settarget_is_ephemeral to write a commit to the ephemeral namespace. Set ephemeral to read or
list the files of an ephemeral branch. In Go, the fields are TargetIsEphemeral and Ephemeral.
Branch from an ephemeral base
Setbase_is_ephemeral when another ephemeral branch is the base. Also set base_branch.
Promote an ephemeral branch
Promote an ephemeral branch to the default namespace withrepos.branches.create. Keep the same branch name or use a new name.