Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Notes: Attach Metadata to Git Objects

Create a disposable repository with at least two commits. Add a review note to the first commit, inspect it with `show` and `list`, append a second observation, and copy the resulting note to the second commit. Create a separate `refs/notes/review` annotation set and verify that its note is independent of the default notes ref. Remove one note and verify that it is gone. Run `git notes prune -n` and explain why note history is stored separately from the annotated commit. Finally, create two notes refs and perform a non-conflicting notes merge. Record which refs changed and why none of these operations changed the object ID of the commits.

Advanced ~6 min read

Challenge 1

Complete the Git command to attach or inspect notes.

bash Your answer
git  prune -n

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to attach or inspect notes.

bash Your answer
git  add -m "reviewed" HEAD

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to attach or inspect notes.

bash Your answer
git  show HEAD

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to attach or inspect notes.

bash Your answer
git  list HEAD

Press Ctrl⌘Enter to check your answer