Recall & Review
beginner
What is a Git branch in simple terms?
A Git branch is just a file that stores the hash (a unique ID) of the latest commit on that branch.
Click to reveal answer
beginner
How does Git know which commit a branch points to?
Git reads the branch file which contains the hash of the commit it points to. This hash tells Git the exact snapshot of the project.
Click to reveal answer
intermediate
What happens to the branch file when you make a new commit?
The branch file updates to store the new commit's hash, so the branch always points to the latest commit.
Click to reveal answer
intermediate
Where are branch files stored in a Git repository?
Branch files are stored inside the .git/refs/heads directory as simple text files containing commit hashes.
Click to reveal answer
beginner
Why is it useful to think of branches as files with hashes?
Because it shows branches are lightweight pointers to commits, making Git fast and efficient at switching and managing code versions.
Click to reveal answer
What does a Git branch file contain?
✗ Incorrect
A Git branch file stores the hash of the latest commit it points to, not the full code or commit messages.
Where can you find branch files inside a Git repository?
✗ Incorrect
Branch files are stored as simple files inside the .git/refs/heads directory.
What happens to a branch file when you commit new changes?
✗ Incorrect
The branch file updates to point to the new commit hash after a commit.
Why are branches considered lightweight in Git?
✗ Incorrect
Branches are lightweight because they only store a pointer (hash) to a commit, not full project copies.
What does the commit hash in a branch file represent?
✗ Incorrect
The commit hash uniquely identifies a specific snapshot of the project at that commit.
Explain how Git branches work as files with hashes.
Think about how a branch points to a commit using a simple file.
You got /4 concepts.
Describe where branch files are stored and what they contain in a Git repository.
Look inside the .git folder to find branch files.
You got /3 concepts.