Challenge - 5 Problems
Worktree 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 worktree list after adding a new worktree?You have a main repository and you run
git worktree add ../feature-branch feature. What will git worktree list show?Attempts:
2 left
💡 Hint
The new worktree points to the branch you specify, not master or detached HEAD.
✗ Incorrect
The
git worktree add command creates a new worktree linked to the specified branch. The list shows the path, commit hash, and branch name.🧠 Conceptual
intermediate1:30remaining
Which command correctly lists all worktrees with their paths and HEAD commits?
You want to see all worktrees linked to your repository with their paths and current HEAD commit hashes. Which command do you use?
Attempts:
2 left
💡 Hint
The command to list worktrees is simple and direct.
✗ Incorrect
The
git worktree list command shows all linked worktrees with their paths and HEAD commits.❓ Troubleshoot
advanced2:00remaining
Why does
git worktree list show only one worktree after adding multiple?You added two worktrees using
git worktree add but git worktree list shows only one. What is the most likely cause?Attempts:
2 left
💡 Hint
Worktrees must be linked inside the repository's control.
✗ Incorrect
Worktrees must be added inside the repository or linked properly. Adding outside without linking won't show in the list.
✅ Best Practice
advanced2:00remaining
What is the recommended way to clean up unused worktrees?
You have several worktrees listed by
git worktree list but some are no longer needed. What is the best practice to remove them?Attempts:
2 left
💡 Hint
Git provides a command to safely remove worktrees.
✗ Incorrect
Using
git worktree remove removes the worktree reference and cleans up safely. Manual deletion can cause dangling references.🔀 Workflow
expert3:00remaining
In what order do these commands list and clean worktrees safely?
Arrange these commands in the correct order to list all worktrees, remove an unused one, and then verify cleanup:
Attempts:
2 left
💡 Hint
First list, then remove, prune, and list again to confirm.
✗ Incorrect
You first list worktrees to see current ones, remove the unused worktree, prune to clean references, then list again to verify removal.