> ## 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.

# getImportRemoteURL()

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

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.

<CodeGroup>
  ```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}},
  	},
  })
  ```
</CodeGroup>

## Options

<ParamField path="permissions" type="string[]">
  Array of permissions. Defaults to `["git:read", "git:write"]`.
</ParamField>

<ParamField path="ttl" type="number">
  Token TTL in seconds. Defaults to 1 year.
</ParamField>

<ParamField path="refPolicies" type="object[]">
  Ordered per-ref policy rules (`{ pattern, ops? }`). First match wins. Patterns without a `refs/` prefix are normalized as branch names. The Python SDK names this option `ref_policies`. The Go SDK names it `RefPolicies` with type `storage.RefPolicyList`. See [`getRemoteURL()`](/docs/reference/sdk/get-remote-url) for available operations and the [Branch Protection guide](/docs/guides/branch-protection) for usage.
</ParamField>

## 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 [Imports guide](/docs/guides/imports) for bulk ingestion workflows and cold-storage behavior.
