Repository Integrity and Dependency Problems
Recognize lock files
Git uses locks to coordinate updates. An index.lock can indicate a live writer or an interrupted operation. Do not remove a lock while a process may own it. Identify the affected repository and worktree, coordinate with other writers, preserve work and consult the administrator before any stale-lock cleanup. The lab creates a synthetic lock and proves a refused stage leaves the index unchanged; no real lock is removed.
Inspect object integrity
In a trusted full repository git fsck checks object connectivity and validity. Unreachable or dangling objects alone are not proof of corruption. Missing required objects deserve preservation and investigation; do not prune or delete object directories. In partial clones, promised objects can be intentionally absent. The fixture checks a healthy repository and a shallow clone without damaging objects.
git rev-parse --git-path index.lockgit rev-parse --is-shallow-repositorygit fsck --fullDependency failures are different
A submodule may lack its pinned commit or access to its source; inspect the committed gitlink and local child status before updating. An LFS pointer may exist even if its external payload is unavailable. Verify the authorized source and expected content instead of switching to an arbitrary latest dependency. Shallow history can make ancestor lookups fail without indicating corruption.
Escalate safely
A full verified independent backup may provide missing objects, but do not overwrite the only original. Recover into a separate location and compare refs, historical snapshots and working edits. The fixture verifies shallow parent lookup failure followed by a successful unshallow fetch. Lock ownership, actual corruption, LFS availability and submodule access remain distinct diagnoses.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Repository Integrity and Dependency Problems — knowledge check
Choose evidence-based troubleshooting and data-preserving recovery.
Does index.lock prove a stale lock?
Does a dangling object alone prove corruption?
Why may a shallow clone lack HEAD^?
An LFS pointer exists but payload is missing. What next?
Only original repository may be corrupt. What is safest?