PIERRE COMPUTER COMPANY █
CODE STORAGE
2026
[ LOG IN ]
[ CHANGELOG ]
[ DOCS ]
[H]Home[C]Changelog[M]Manual[P]Pricing[S]Status
← Back
------
Feature:

Repository Upstream Field

Date:October 06, 2026Author:Nicolas GallagherCategory:ENGINEERING
------

The create-repository request now has one field for each kind of source. base_repo is a one-time copy of a Code Storage repository; upstream is a lasting link to an external Git host. Set at most one of the two. A request with both returns 400.

Copy a Code Storage repository

base_repo takes name, ref, and auth.token. The token needs git:read on the source repository. ref accepts a branch, a tag, or a commit SHA. It defaults to the HEAD of the source.

curl "$PIERRE_API_BASE_URL/repos" \
  -X POST \
  -H "Authorization: Bearer $PIERRE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "repo_name": "my-project",
    "base_repo": {
      "name": "template-repo",
      "ref": "main",
      "auth": { "token": "'"$SOURCE_TOKEN"'" }
    }
  }'
{
  "repo_name": "my-project",
  "message": "Repository 'NSIZAW55paRNvTbRYvvu4' created successfully"
}

The new repository has one branch at the source commit, with the history of that commit. It keeps no link to the source.

Sync from an external Git host

upstream takes provider, owner, and name. Set host for a self-hosted provider. For a public GitHub repository, set access to public. Code Storage then needs no GitHub App, and it syncs only when you ask:

curl "$PIERRE_API_BASE_URL/repos" \
  -X POST \
  -H "Authorization: Bearer $PIERRE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "repo_name": "hello-world",
    "upstream": {
      "provider": "github",
      "owner": "octocat",
      "name": "Hello-World",
      "access": "public"
    }
  }'
{
  "repo_name": "hello-world",
  "message": "Repository 'rX8TDSb7Oq7JLbl5stQBt' created successfully"
}

A read of the repository returns its upstream:

curl "$PIERRE_API_BASE_URL/repos/hello-world" \
  -H "Authorization: Bearer $PIERRE_TOKEN"
{
  "repo_name": "hello-world",
  "default_branch": "master",
  "created_at": "2026-10-06T20:34:45Z",
  "upstream": {
    "provider": "github",
    "owner": "octocat",
    "name": "Hello-World"
  }
}

The response also has base_repo, with the same value as upstream. It is deprecated. Read upstream instead.

Deprecated fields

The old form of base_repo, with provider and operation, still works. It is deprecated. Move a sync to upstream, and keep name in upstream.name. Move each other field to its replacement:

Deprecated fieldReplacement
base_repo.providerupstream.provider. A copy has no provider.
base_repo.ownerupstream.owner
base_repo.operationupstream for a sync, and base_repo for a copy
base_repo.shabase_repo.ref, which accepts a commit SHA
base_repo.upstream_hostupstream.host
base_repo.auth.auth_typeupstream.access for a public GitHub sync. A copy has none
base_repo.default_branchthe top-level default_branch
response base_reporesponse upstream

See the API reference for repos.create, and the guides for forks, GitHub Sync, and Generic Sync.

+ Recently +

  • Oct 05, 2026
    Webhook Custom Headers
    Sean Lingren
  • Oct 02, 2026
    Rendered Markdown
    Mark Otto
  • Sep 23, 2026
    Custom Git Notes Refs
    Nicolas Gallagher
[See all]
+ + + + + + + + + + + + + + + + + + + + + +
© Pierre Computer Company, Inc. All rights reserved.
[ LOG IN ]
[ CHANGELOG ]
[ DOCS ]
Docs|Status|Pricing|Log in|Legal