Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Repository Integrity: Verify with git fsck

Create a disposable repository with two normal commits and a tag. Run `git fsck`, `--full`, `--connectivity-only`, `--root`, `--tags`, and `--name-objects`, and explain what each adds or changes. Then create a third commit on a temporary branch, delete that branch, and compare `git fsck --unreachable` with `git fsck --unreachable --no-reflogs`. Identify the orphaned commit and explain why its supporting tree/blob objects may also appear. Finally, run `git fsck --full --strict --no-dangling` and record the clean result. Do not delete or rewrite any objects as part of the exercise.

Advanced ~6 min read

Challenge 1

Complete the Git command to check repository object integrity.

bash Your answer
git 

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to check repository object integrity.

bash Your answer
git  --unreachable

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to check repository object integrity.

bash Your answer
git  --unreachable --no-reflogs

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to check repository object integrity.

bash Your answer
git  --full --strict --no-dangling

Press Ctrl⌘Enter to check your answer