wit fsck
Thewit fsck (file system check) command verifies the integrity and connectivity of objects in the repository.
Overview
fsck checks for:
- Corrupted objects
- Missing objects
- Dangling objects (unreachable)
- Invalid references
- Connectivity issues
Usage
Output
With Issues
Options
Common Checks
Object Integrity
Verifies each object:- Correct hash matches content
- Valid object format
- Proper compression
Connectivity
Ensures all references are valid:- Commits reference valid trees
- Trees reference valid blobs and trees
- Parent commits exist
References
Validates all refs:- Branches point to valid commits
- Tags point to valid objects
- HEAD is valid
Examples
Quick Check
Find Dangling Objects
Verbose Check
Strict Mode
Recovering Lost Data
From Dangling Objects
From Lost-Found
Repair Mode
Warning: Use --repair with caution. Always backup first.
- Remove references to missing objects
- Rebuild broken links where possible
- Clean up corrupted partial objects
When to Use
After System Crash
After Disk Errors
Periodic Maintenance
Before Important Operations
Comparison with Git
Related
- wit gc - Garbage collection
- wit reflog - Reference history
- wit cat-file - Inspect objects