Recall & Review
beginner
What is the HEAD pointer in Git?
HEAD is a reference that points to the current commit you have checked out in your working directory. It tells Git where you are in the project history.
Click to reveal answer
intermediate
What does it mean when HEAD is 'detached' in Git?
A detached HEAD means HEAD points directly to a commit instead of a branch. Changes made here are not linked to any branch until you create one or move HEAD.
Click to reveal answer
beginner
How does HEAD relate to branches in Git?
HEAD usually points to the latest commit on the current branch. When you switch branches, HEAD moves to point to the tip of that branch.
Click to reveal answer
intermediate
What happens if you commit while in a detached HEAD state?
The commit is created but not attached to any branch. It can be lost if you switch branches without saving it by creating a new branch.
Click to reveal answer
beginner
How can you check where HEAD is pointing in Git?
You can run the command git status or git symbolic-ref HEAD to see the current branch or commit HEAD points to.
Click to reveal answer
What does the HEAD pointer in Git usually point to?
✗ Incorrect
HEAD normally points to the latest commit on the branch you have checked out.
What is a detached HEAD in Git?
✗ Incorrect
Detached HEAD means HEAD points to a commit directly, not to a branch.
Which command shows the current branch HEAD points to?
✗ Incorrect
git status shows the current branch and where HEAD points.
If you commit in a detached HEAD state and then switch branches without saving, what happens?
✗ Incorrect
Commits made in detached HEAD can be lost if not saved by creating a branch.
When you switch branches, what happens to HEAD?
✗ Incorrect
HEAD moves to the latest commit of the branch you switch to.
Explain what the HEAD pointer is in Git and why it is important.
Think about how Git tracks your current position in the project history.
You got /3 concepts.
Describe what happens when HEAD is detached and how to safely work in that state.
Consider what it means to be 'detached' and how to keep your changes safe.
You got /3 concepts.