Senior LevelGit & GitHub
How do you diagnose and repair corrupted Git object databases using git fsck?
❓ Interview Prompt: Explain Git file system check (git fsck), diagnosing object database corruption, dangling objects, and recovering corrupted blobs from fresh clones.
git fsck --full inspects object database integrity. Repairing corruption involves isolating missing blob hashes and restoring intact object files from clean backup clones.
Code Implementation Example
bash
git fsck --full --unreachable
cp ../clean-clone/.git/objects/a1/b2c3d4... .git/objects/a1/b2c3d4...💡Diagnosing and repairing object database corruption using git fsck.
🎯 Interview Key Takeaway
Use git fsck --full to audit object database corruption, and restore broken object blobs from clean remote clones.
#git fsck#Corruption Repair#Disaster Recovery#Senior
Back to all Git & GitHub Questions→