Tags
Tag operations are available via repo.tags.
List tags
Section titled “List tags”let tags = try repo.tags.list()for tag in tags { print(tag.name)}Create a lightweight tag
Section titled “Create a lightweight tag”A lightweight tag is just a named pointer to a commit — no metadata.
let commit = try repo.log(limit: 1).first!try repo.tags.create(named: "v1.0.0", at: commit)Create an annotated tag
Section titled “Create an annotated tag”An annotated tag stores a message, tagger identity, and timestamp.
let tagger = Signature(name: "Alice", email: "alice@example.com")let commit = try repo.log(limit: 1).first!try repo.tags.create( named: "v1.0.0", at: commit, message: "Initial public release", tagger: tagger)Delete a tag
Section titled “Delete a tag”try repo.tags.delete(named: "v1.0.0")Tag model
Section titled “Tag model”public struct Tag: Sendable, Identifiable { public let name: String public let oid: OID public let message: String? // nil for lightweight tags public let tagger: Signature?}