0
0
Gitdevops~10 mins

Creating a worktree in Git - Interactive Practice

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

Complete the command to create a new worktree named 'feature' based on the branch 'develop'.

Git
git worktree add [1] develop
Drag options to blanks, or click blank then click option'
Aorigin
Bfeature
Cmaster
Dmain
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong directory name like 'master' or 'main' when the branch is 'develop'.
Confusing the branch name with the directory name.
2fill in blank
medium

Complete the command to list all existing worktrees.

Git
git worktree [1]
Drag options to blanks, or click blank then click option'
Alist
Bshow
Cstatus
Dcheck
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'show' or 'status' which are not valid subcommands for 'git worktree'.
Confusing with other git commands like 'git status'.
3fill in blank
hard

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

Git
git worktree [1] feature
Drag options to blanks, or click blank then click option'
Aremove-worktree
Bdelete
Cremove
Dprune
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'prune' which does not take a path argument and is for cleaning up non-existent worktrees.
Using 'delete' which is not a valid git worktree subcommand.
4fill in blank
hard

Fill both blanks to create a new worktree named 'hotfix' based on a new branch 'hotfix-1.0'.

Git
git worktree add -b [1] [2]
Drag options to blanks, or click blank then click option'
Ahotfix-1.0
Bhotfix
Dmain
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping branch name and directory name.
Using the wrong branch name or directory.
5fill in blank
hard

Fill all three blanks to create a worktree for branch 'release' in directory 'release-dir' and then switch to it.

Git
git worktree add [1] [2]
git -C [3] switch release
Drag options to blanks, or click blank then click option'
Arelease-dir
Brelease
Dmain
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up branch and directory names.
Forgetting to specify the directory in the switch command.