> ## Documentation Index
> Fetch the complete documentation index at: https://code.storage/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# repo.getImportRemoteURL()

> Generate authenticated Git URLs pointing to the +import namespace for bulk repository ingestion.

> [!WARNING]
>
> This page documents the earlier Code Storage SDKs: `@pierre/storage`, `pierre-storage`, and
> `code-storage-go`. New code uses the [Pierre SDK](https://code.storage/docs/sdks.md). To move code to the new SDK, use the
> [`pierre-migrate`
> skill](https://github.com/pierrecomputer/skills/tree/main/skills/pierre-migrate).

Returns a JWT-authenticated remote URL targeting the `+import` push namespace. Pushing to this URL
triggers immediate cold-storage archival after pack distribution—useful for bulk ingestion where you
don't need the repository to stay on hot disk.

```typescript TypeScript theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
// Default: read/write access, 1-year TTL
const importUrl = await repo.getImportRemoteURL();
// Returns: https://t:JWT@your-name.code.storage/repo-id+import.git

// Short-lived URL for a single push
const ciImportUrl = await repo.getImportRemoteURL({
  permissions: ['git:read', 'git:write'],
  ttl: 3600,
});

// Disable force push on every branch
const safeImportUrl = await repo.getImportRemoteURL({
  refPolicies: [{ pattern: 'refs/heads/*', ops: ['no-force-push'] }],
});
```

```python Python theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
# Default: read/write access, 1-year TTL
import_url = await repo.get_import_remote_url()
# Returns: https://t:JWT@your-name.code.storage/repo-id+import.git

# Short-lived URL for a single push
ci_import_url = await repo.get_import_remote_url(
    permissions=['git:read', 'git:write'],
    ttl=3600,
)

# Disable force push on every branch
safe_import_url = await repo.get_import_remote_url(
    ref_policies=[{"pattern": "refs/heads/*", "ops": ["no-force-push"]}],
)
```

```go Go theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
// Default: read/write access, 1-year TTL
importURL, err := repo.ImportRemoteURL(context.Background(), storage.RemoteURLOptions{})
fmt.Println(importURL)
// Prints: https://t:JWT@your-name.code.storage/repo-id+import.git

// Short-lived URL for a single push
ciImportURL, err := repo.ImportRemoteURL(context.Background(), storage.RemoteURLOptions{
	Permissions: []storage.Permission{
		storage.PermissionGitRead,
		storage.PermissionGitWrite,
	},
	TTL: time.Hour,
})

// Disable force push on every branch
safeImportURL, err := repo.ImportRemoteURL(context.Background(), storage.RemoteURLOptions{
	RefPolicies: storage.RefPolicyList{
		{Pattern: "refs/heads/*", Ops: storage.Ops{storage.OpNoForcePush}},
	},
})
```

## Options

**permissions** `string[]`

Array of permissions. Defaults to `["git:read", "git:write"]`.

**ttl** `number`

Token TTL in seconds. Defaults to 1 year.

**refPolicies** `object[]`

Ordered ref policy rules (`{ pattern, ops? }`). Code Storage uses the first rule that matches the target ref. It treats a pattern without `refs/` as a branch name. Python: `ref_policies`. Go: `RefPolicies` with type `storage.RefPolicyList`. See [`getRemoteURL()`](https://code.storage/docs/sdk/repos/remote-url-get) for operations and [Ref Policies](https://code.storage/docs/repos/ref-policies.md) for use.

## Response

Returns a `string` containing the HTTPS Git remote URL with embedded JWT authentication:

```
https://t:{jwt}@{org}.code.storage/{repo-id}+import.git
```

## Usage

Use the URL as a standard Git remote. Pushing to it enqueues cold-storage archival immediately after
the pack distributes to all nodes:

```bash theme={"theme":{"light":"github-light","dark":"min-dark"}}
git remote add import <url>
git push import main
git push import --tags
```

See the [Import Namespace guide](https://code.storage/docs/repos/imports.md) for bulk ingestion workflows and cold-storage
behavior.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.