Challenge - 5 Problems
Git Untracked vs Tracked Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Identify tracked and untracked files
You run
git status and see some files listed under 'Untracked files' and others under 'Changes not staged for commit'. What does this mean about these files?Attempts:
2 left
💡 Hint
Think about whether Git knows about the file or not.
✗ Incorrect
Untracked files are new files Git has not been told to track yet. Modified tracked files are known to Git but have changes not yet staged.
💻 Command Output
intermediate2:00remaining
Output of git status with untracked files
What is the output of
git status after creating a new file notes.txt but before adding it?Git
$ touch notes.txt
$ git statusAttempts:
2 left
💡 Hint
The file is new and not added yet.
✗ Incorrect
New files show under 'Untracked files' until added with git add.
🔀 Workflow
advanced2:00remaining
Correct workflow to track a new file
You created a new file
app.log but want Git to track it. Which sequence of commands correctly tracks and commits this file?Attempts:
2 left
💡 Hint
Think about the order: add first, then commit.
✗ Incorrect
You must add the file to the staging area before committing it.
❓ Troubleshoot
advanced2:00remaining
Why is a new file not showing as untracked?
You created a new file
secret.txt but git status does not show it as untracked. What is the most likely reason?Attempts:
2 left
💡 Hint
Check if Git is told to ignore the file.
✗ Incorrect
Files listed in .gitignore do not show as untracked because Git ignores them.
✅ Best Practice
expert2:00remaining
Best practice for handling large untracked log files
Your project generates large log files that should not be tracked by Git. What is the best practice to handle these files?
Attempts:
2 left
💡 Hint
Think about avoiding clutter and large files in Git.
✗ Incorrect
Adding large generated files to .gitignore keeps the repo clean and avoids unnecessary commits.