Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Commit-Graph: Accelerating Commit History Walks

Create a disposable repository with several commits and at least one changed path. First inspect the history with `git log --oneline --graph --all`. Write a reachable commit-graph and verify it. Then write it again with `--reachable --changed-paths` and verify it. Remove the single-file graph in the disposable repository, create a split graph with `--reachable --split --changed-paths`, list the resulting `commit-graphs` directory, and verify the chain. Finally run `git fsck --full` and explain why its responsibility differs from `git commit-graph verify`. Record which commands changed derived graph data and which commands only inspected it. This lesson uses only official Git project documentation for command semantics: `git-commit-graph`, the commit-graph design documentation, `commit-graph-format`, `git-fsck`, and the Git 2.56.0 command index. No third-party Git documentation is used for command semantics.

Advanced ~6 min read

Challenge 1

Complete the Git command to write or verify commit-graph data.

bash Your answer
git  verify

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to write or verify commit-graph data.

bash Your answer
git  write --reachable

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to write or verify commit-graph data.

bash Your answer
git  write --reachable --changed-paths

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to write or verify commit-graph data.

bash Your answer
git  write --reachable --split --changed-paths

Press Ctrl⌘Enter to check your answer