In Git's commit graph, what is a branch?
- A saved copy of every file in the working folder
- A movable label pointing to a commit
- A parent link stored inside every newly made commit
Which description fits a Git commit?
- A snapshot record with links to zero or more parents
- A moving branch name that stores the current file edits
- A second working folder containing each branch's files
main points to commit C. Creating feature at C adds a branch label but no new commit.
Circle one: True False
feature points to C. You check out C using its commit ID. What happens to HEAD?
- It points directly to C and is detached
- It points to feature and stays attached
- It deletes feature and points directly to C
Start with only root commit A, main at A and HEAD pointing to main. Make ordinary commit B, create feature at B, switch to feature, then make ordinary commit C. Which record gives all commit-to-parent arrows and the final pointers?
- Arrows: A to B, B to C; main: B; feature: C; HEAD: feature
- Arrows: B to A, C to B; main: C; feature: C; HEAD: feature
- Arrows: B to A, C to B; main: B; feature: C; HEAD: feature
main stays at C. With HEAD detached at C, you make D and then E. No branch leads to D or E. You switch to main. What is the risk?
- They are deleted immediately when HEAD returns to the main branch
- They may be harder to find without a branch leading to them
- They are merged into main automatically when HEAD returns there
A merge commit with two parents creates a directed cycle in Git's commit graph.
Circle one: True False
HEAD is detached at H. H has parent G, and G has parent F. You want to return to main while keeping this history easy to find. What should you do before switching?
- Create a branch at F before switching
- Delete commits G and H before switching
- Create a branch at H before switching