Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git name-rev: Find Symbolic Names for Commits

Create a disposable repository with at least three commits, a branch, and a tag. Then run the following workflow. Record which symbolic name Git chooses for `HEAD~1`, compare branch-based naming with `--tags`, restrict the candidates with `--refs`, and finally annotate a line containing the current commit ID. Expected learning outcome: you can explain why the reported name depends on the candidate refs, and you can distinguish a symbolic description from an actual ref stored in the repository.

Advanced ~6 min read

Challenge 1

Complete the Git command to find a symbolic commit name.

bash Your answer
git  HEAD~1

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to find a symbolic commit name.

bash Your answer
git  --tags HEAD~1

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to find a symbolic commit name.

bash Your answer
git  --refs='refs/heads/*' HEAD~1

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to find a symbolic commit name.

bash Your answer
git 

Press Ctrl⌘Enter to check your answer