0
0
Gitdevops~20 mins

git fsck for repository integrity - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Git Integrity Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
What does git fsck report when the repository is healthy?
Run git fsck on a perfectly intact Git repository. What output do you expect?
Git
git fsck
Aerror: missing blob object
Bfatal: not a git repository (or any of the parent directories): .git
Cerror: corrupt object detected
DChecking object directories: 100% (256/256), done.
Attempts:
2 left
💡 Hint
Think about what git fsck does when everything is fine.
🧠 Conceptual
intermediate
1:30remaining
What does git fsck check in a Git repository?
Select the best description of what git fsck verifies in a Git repository.
AIt verifies the integrity and connectivity of Git objects and references.
BIt merges branches and resolves conflicts automatically.
CIt cleans up unnecessary files and optimizes the repository.
DIt checks for uncommitted changes in the working directory.
Attempts:
2 left
💡 Hint
Think about what 'fsck' stands for in other systems.
Troubleshoot
advanced
2:00remaining
You ran git fsck and got error: missing blob object. What is the likely cause?
After running git fsck, you see the error error: missing blob object. What does this mean?
AA Git object file is missing or corrupted, causing repository inconsistency.
BThe working directory is not clean; files are staged but not committed.
CThe repository has uncommitted changes that need to be committed.
DThe remote repository is unreachable due to network issues.
Attempts:
2 left
💡 Hint
Missing blob means Git cannot find an object it expects.
🔀 Workflow
advanced
2:30remaining
What is the correct sequence to verify and repair a corrupted Git repository?
You suspect your Git repository is corrupted. Which sequence of commands correctly checks and attempts to fix it?
A3,1,4,2
B1,3,4,2
C1,2,3,4
D2,1,3,4
Attempts:
2 left
💡 Hint
Start by checking integrity, then find good commits, reset, and clean up.
Best Practice
expert
3:00remaining
Which practice helps prevent repository corruption detected by git fsck?
Choose the best practice that reduces the chance of repository corruption that git fsck would detect.
ADeleting the .git directory to reset the repository when errors occur.
BAvoiding commits and pushing directly to remote without local history.
CRegularly running <code>git gc</code> and backing up the .git directory.
DUsing shallow clones exclusively to reduce repository size.
Attempts:
2 left
💡 Hint
Think about maintenance and backups for safety.