> ## 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.createTag()

> Create a lightweight tag pointing to a specific commit.

> [!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).

```typescript TypeScript theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
const tag = await repo.createTag({
  name: 'v1.0.0',
  target: 'abc123def456...', // commit SHA to tag
});

console.log(tag.name); // 'v1.0.0'
console.log(tag.sha); // resolved SHA
```

```python Python theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
tag = await repo.create_tag(
    name="v1.0.0",
    target="abc123def456...",  # commit SHA to tag
)

print(tag["name"])  # 'v1.0.0'
print(tag["sha"])   # resolved SHA
```

```go Go theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
// Create a tag
tag, err := repo.CreateTag(context.Background(), storage.CreateTagOptions{
	Name:   "v1.0.0",
	Target: "abc123def456...",
})

fmt.Println(tag.Name) // v1.0.0
fmt.Println(tag.SHA)  // resolved SHA
```

Tag names must not start with `refs/` — the SDK handles ref resolution automatically.

## Options

**name** `string` *required*

Tag name (e.g. `v1.0.0`). Must not start with `refs/`.

**target** `string` *required*

Commit SHA the tag should point to.

**refPolicies** `object[]`

Ordered ref policy rules (`{ pattern, ops? }`) in the JWT for this call. Code Storage uses the first rule that matches the target ref. Python: `ref_policies`. Go: `RefPolicies` with type `storage.RefPolicyList`. See [Ref Policies](https://code.storage/docs/repos/ref-policies.md).

## Response

**name** `string`

The created tag name

**sha** `string`

The resolved commit SHA the tag points to

**message** `string`

Confirmation message from the API


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