Git Rev-parse HEAD
Predict Output Medium
Question
What does this code print?
Code
git rev-parse HEAD
# a1b2c3d4e5f6...
Hint
rev-parse HEAD gives the commit hash.
Explanation
git rev-parse HEAD prints the full 40-character hash of the current commit. This is useful in scripts for getting the commit identifier. Use --short for an abbreviated hash.
Related Resources
Related Lessons
- Git Log
Learn git log.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.