Recall & Review
beginner
What does the command
git diff branch1 branch2 do?It shows the differences between the files in
branch1 and branch2. You can see what changes exist from one branch to the other.Click to reveal answer
beginner
How can you see only the names of files that differ between two branches?
Use
git diff --name-only branch1 branch2. This lists just the file names that have changes.Click to reveal answer
intermediate
What is the difference between
git diff branch1 branch2 and git diff branch2 branch1?The output shows changes from the first branch to the second. So switching the order reverses the direction of the diff.
Click to reveal answer
beginner
Can
git diff show changes between your current working directory and a branch?Yes. Use
git diff branch_name to see changes between your current files and that branch.Click to reveal answer
beginner
What does the
--stat option do with git diff?It shows a summary of changes with file names and how many lines were added or removed, instead of full details.
Click to reveal answer
Which command shows the detailed differences between two branches?
✗ Incorrect
git diff branch1 branch2 shows the line-by-line differences between two branches.
How do you list only the files that differ between two branches?
✗ Incorrect
The --name-only option lists just the file names that differ.
What happens if you swap the branch order in
git diff branch1 branch2 to git diff branch2 branch1?✗ Incorrect
The diff direction reverses, showing changes from the first branch to the second.
Which command shows a summary of changes with line counts between branches?
✗ Incorrect
--stat shows a summary with lines added and removed per file.
Can
git diff branch_name show changes between your current files and a branch?✗ Incorrect
This command compares your current working directory to the specified branch.
Explain how to use
git diff to compare two branches and what the output means.Think about comparing two versions of a document to see what changed.
You got /4 concepts.
Describe how to get a quick list of files that differ between two branches without full details.
Imagine checking which chapters changed without reading the whole text.
You got /4 concepts.