What is the main purpose of the staging area in Git before committing changes?
Think about how you prepare a photo album by picking only some pictures before printing.
The staging area lets you pick exactly which changes to save in your next commit. This helps keep commits clean and focused.
What will git status show after you run git add file.txt but before committing?
git add file.txt git status
After adding, the file is ready to be saved in the next commit.
Running git add moves changes to the staging area, so git status shows them as ready to commit.
Which sequence of commands correctly stages and commits a file named app.py with a message 'Add app script'?
Remember: add first, then commit with message.
You must stage files with git add before committing. The commit command includes the message.
You modified index.html but after running git commit -m 'Update', the changes are not saved in the commit. What is the likely reason?
Think about how you must tell Git which changes to save.
Git only commits changes that have been staged. If you skip git add, the commit won't include your edits.
What is the main benefit of staging and committing small, focused changes instead of one big commit?
Think about how organizing photos by event helps find them later.
Small commits help teams review code clearly and fix problems by undoing specific changes without affecting others.