Stash
Stash operations are available via repo.stash.
Push (save) a stash
Section titled “Push (save) a stash”let author = Signature(name: "Alice", email: "alice@example.com")try repo.stash.push(message: "WIP: login screen", author: author)List stashes
Section titled “List stashes”let stashes = try repo.stash.list()for entry in stashes { print(entry.index, entry.message)}Apply a stash
Section titled “Apply a stash”Apply without removing it from the stash list:
try repo.stash.apply(index: 0)Pop a stash
Section titled “Pop a stash”Apply and remove from the stash list:
try repo.stash.pop(index: 0)Drop a stash
Section titled “Drop a stash”Remove without applying:
try repo.stash.drop(index: 0)StashEntry model
Section titled “StashEntry model”public struct StashEntry: Sendable, Identifiable { public let index: Int public let message: String public let oid: OID}