Challenge - 5 Problems
Git Status Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of
git status after modifying a tracked file?You have a tracked file named
app.py. You edit it but do not stage the changes. What will git status show?Attempts:
2 left
💡 Hint
Think about what happens when you change a file but don't stage it.
✗ Incorrect
When you modify a tracked file but don't stage it, git status shows it under "Changes not staged for commit" with the file name listed as modified.
💻 Command Output
intermediate2:00remaining
What does
git status show after staging a new file?You create a new file
README.md and run git add README.md. What will git status display?Attempts:
2 left
💡 Hint
What does staging a file do to its status?
✗ Incorrect
After staging a new file, git status shows it under "Changes to be committed" as a new file.
❓ Troubleshoot
advanced2:00remaining
Why does
git status show 'fatal: not a git repository'?You run
git status inside a folder but get the error: fatal: not a git repository (or any of the parent directories): .git. What is the most likely cause?Attempts:
2 left
💡 Hint
Think about what makes a folder a git repository.
✗ Incorrect
This error means the current folder or its parents do not contain a .git folder, so git commands cannot run.
✅ Best Practice
advanced2:00remaining
Which
git status output indicates a clean working directory ready for a new commit?You want to confirm your working directory has no changes before starting new work. Which
git status output shows this?Attempts:
2 left
💡 Hint
Look for the message that says there are no changes.
✗ Incorrect
The message "nothing to commit, working tree clean" means no changes are staged or unstaged.
🔀 Workflow
expert3:00remaining
What sequence of
git status outputs occurs when you modify, stage, and then unstage a file?You modify
app.js, stage it, then unstage it using git restore --staged app.js. What is the correct order of git status outputs after each step?Attempts:
2 left
💡 Hint
Think about how staging and unstaging affect the file's status.
✗ Incorrect
First, modifying the file shows it as unstaged changes (1). Staging it moves it to changes to be committed (2). Unstaging returns it to unstaged changes (3).