Recall & Review
beginner
What does the
git add command do?It moves changes in your files into the staging area, preparing them to be saved in the next commit.
Click to reveal answer
beginner
How do you stage a single file named
index.html?Use the command
git add index.html to stage that specific file.Click to reveal answer
intermediate
What is the difference between
git add . and git add -A?git add . stages new and modified files in the current directory and below, but not deletions. git add -A stages all changes including deletions everywhere.Click to reveal answer
intermediate
Can
git add be used to stage parts of a file?Yes, using
git add -p lets you choose specific changes (hunks) inside files to stage.Click to reveal answer
beginner
Why is staging files useful before committing?
Staging lets you control exactly which changes go into your next commit, helping keep commits clear and organized.
Click to reveal answer
What does
git add do?✗ Incorrect
git add prepares changes by moving them to the staging area before committing.Which command stages all changes including deletions?
✗ Incorrect
git add -A stages all changes including file deletions.How do you stage only part of a file's changes?
✗ Incorrect
git add -p lets you interactively select parts of changes to stage.What happens if you run
git add on a file that has no changes?✗ Incorrect
If there are no changes,
git add does nothing because there is nothing new to stage.Why should you use staging before committing?
✗ Incorrect
Staging lets you pick exactly what changes to include in your next commit.
Explain what the
git add command does and why it is important in the Git workflow.Think about how you prepare things before saving them permanently.
You got /3 concepts.
Describe the difference between
git add . and git add -A.One includes deletions, the other does not.
You got /2 concepts.