Challenge - 5 Problems
Working Directory Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Identify the output of 'git status' after file modification
You have a Git repository. You modified a tracked file named
app.py but have not staged the changes yet. What will be the output of git status?Git
git statusAttempts:
2 left
💡 Hint
Think about what happens when you modify a file but do not stage it.
✗ Incorrect
When a tracked file is modified but not staged, 'git status' shows it under 'Changes not staged for commit'.
🧠 Conceptual
intermediate1:30remaining
Understanding the working directory vs staging area
Which statement correctly describes the difference between the working directory and the staging area in Git?
Attempts:
2 left
💡 Hint
Think about where you make changes and where you mark changes for commit.
✗ Incorrect
The working directory is your local files you edit. The staging area holds changes you want to include in the next commit.
❓ Troubleshoot
advanced2:00remaining
Diagnosing untracked files after git add
You ran
git add README.md but git status still shows README.md as untracked. What is the most likely cause?Attempts:
2 left
💡 Hint
Check if the file is excluded by Git rules.
✗ Incorrect
If a file is ignored by .gitignore, adding it won't track it, so it remains untracked.
🔀 Workflow
advanced2:30remaining
Sequence to discard changes in working directory
You accidentally modified a file
config.yaml and want to discard all changes, restoring it to the last committed state. Which sequence of commands achieves this?Attempts:
2 left
💡 Hint
Think about the simplest way to discard unstaged changes.
✗ Incorrect
The command 'git restore config.yaml' alone discards changes in the working directory restoring the last commit version.
✅ Best Practice
expert3:00remaining
Best practice to keep working directory clean in a team
In a team project, what is the best practice to ensure the working directory stays clean and avoids conflicts before starting new work?
Attempts:
2 left
💡 Hint
Think about temporarily saving work without committing.
✗ Incorrect
Using 'git stash' saves your changes temporarily, keeping the working directory clean and allowing safe branch switching or updates.