0
0
Gitdevops~10 mins

Removing worktrees in Git - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to remove a Git worktree named 'feature'.

Git
git worktree [1] feature
Drag options to blanks, or click blank then click option'
Aremove
Badd
Clist
Dprune
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'add' instead of 'remove' will try to create a worktree, not delete it.
Using 'list' only shows worktrees, it does not remove them.
2fill in blank
medium

Complete the command to clean up references to worktrees that no longer exist.

Git
git worktree [1]
Drag options to blanks, or click blank then click option'
Aremove
Badd
Cprune
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'remove' deletes a specific worktree, not cleanup references.
Using 'list' only shows worktrees, it does not clean up.
3fill in blank
hard

Fix the error in the command to remove a worktree located at 'path/to/worktree'.

Git
git worktree [1] path/to/worktree
Drag options to blanks, or click blank then click option'
Aremove
Bdelete
Crm
Dclean
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'delete' or 'rm' causes an error because these are not valid subcommands.
Using 'clean' is a different Git command unrelated to worktrees.
4fill in blank
hard

Fill both blanks to remove a worktree and then prune stale references.

Git
git worktree [1] feature && git worktree [2]
Drag options to blanks, or click blank then click option'
Aremove
Bprune
Clist
Dadd
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'list' instead of 'prune' does not clean stale references.
Using 'add' instead of 'remove' tries to create a worktree.
5fill in blank
hard

Fill all three blanks to remove a worktree at 'mytree', prune stale references, and list current worktrees.

Git
git worktree [1] mytree && git worktree [2] && git worktree [3]
Drag options to blanks, or click blank then click option'
Aremove
Bprune
Clist
Dadd
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'add' instead of 'remove' will create a worktree instead of deleting.
Mixing the order can cause confusion about what each command does.