# models

Plain-data git models for commits, tags, and refs, with factories and small predicates.

[`GitCommit`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-GitCommit), [`GitRef`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-GitRef), and [`GitTag`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-GitTag) are the structured shapes consumed by every other git module. Factories ([`createGitCommit`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-createGitCommit), [`createGitRef`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-createGitRef), [`createLightweightTag`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-createLightweightTag), [`createAnnotatedTag`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-createAnnotatedTag)) produce instances from raw fields. Predicates ([`isSameCommit`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-isSameCommit), [`isMergeCommit`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-isMergeCommit), [`isRootCommit`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-isRootCommit), [`isBranchRef`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-isBranchRef), [`isTagRef`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-isTagRef), [`isRemoteRef`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-isRemoteRef), [`isHeadRef`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-isHeadRef)) and accessors ([`getShortHash`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-getShortHash), [`extractScope`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-extractScope), [`extractType`](https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/#api-extractType)) cover the common questions consumers ask of these models without having to re-derive the answers from the raw git output.

---

Canonical page: https://www.hyperfrontend.dev/docs/libraries/versioning/git/models/
This file: https://www.hyperfrontend.dev/docs/libraries/versioning/git/models.md
Documentation index: https://www.hyperfrontend.dev/llms.txt
