Git alternate object database
A Git alternate object database is an additional object directory that a repository searches for objects it does not store locally.
Lookup scope: objects/info/alternates and GIT_ALTERNATE_OBJECT_DIRECTORIES can make objects available outside the repository's own object directory; full fsck includes these stores. A passing check therefore does not establish that a copied directory is self-contained. [2]
Copy independence: clone --shared can borrow objects from its source. Repack without --local can copy borrowed reachable objects; local-only repacking deliberately excludes them. The --dissociate clone option breaks borrowing after transfer, but object-provider independence is separate from physical-media independence. [1] [3]
Measured boundary: in Hesela's Git 2.43.0 fixture, shared and local-repacked copies failed after their provider pathname became unavailable while their own file hashes remained unchanged. Full-repack and dissociate controls remained readable. This is a controlled provider-disconnection test, not a garbage-collection or device-failure measurement. [4]
Relations
Advantages
- Allows object reuse without immediately duplicating an entire object store.
Limitations
- Availability can depend on an external repository and its object retention policy.
Citations
- Git v2.43.0: shared clones, local repacking and dissociation
- Git v2.43.0: full and connectivity-only object checks
- Git v2.43.0: pack-objects --local
- Hesela: Git backup dependency and verification controls
Sources & caveats
- Versioned Git documentation and disposable native-Git 2.43.0 controls; no fleet failure-rate estimate.