Challenge 1
Complete the Git command to inspect or remove unreachable objects.
git -n -v --expire=now
Press Ctrl⌘Enter to check your answer
In a disposable repository, create a commit on a temporary branch, delete that branch, and expire the test repository's reflogs so the commit becomes genuinely unreachable for the experiment. Use `git fsck --unreachable --no-reflogs` to identify the unreachable commit and supporting objects. Run `git prune -n -v --expire=now` and record the candidates without changing the repository. Confirm the unreachable commit still exists. Then run `git prune --expire=now` and verify that the commit can no longer be resolved as an object. Repeat the experiment with an additional `<head>` pointing to the temporary commit and prove with a dry run that objects reachable from that head are protected. Finally explain why the same operation would be risky in a real repository and why `git gc` is normally preferred for routine maintenance. This lesson uses only official Git project documentation for command semantics: `git-prune`, the Git 2.56.0 command index, and the official `git-fsck` and `git-gc` documentation for command boundaries. No third-party Git documentation is used for command semantics.
Challenge 1
git -n -v --expire=now
Press Ctrl⌘Enter to check your answer
Challenge 2
git --expire=now
Press Ctrl⌘Enter to check your answer
Challenge 3
git -n -v --expire=never
Press Ctrl⌘Enter to check your answer
Challenge 4
git -n -v --progress --expire=now
Press Ctrl⌘Enter to check your answer