0
0
Gitdevops~10 mins

Worktrees vs stashing decision 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' from the current branch.

Git
git worktree add [1]
Drag options to blanks, or click blank then click option'
Astash
Bbranch
Ccommit
Dfeature
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stash' or 'commit' as the folder name causes confusion.
Forgetting to specify the folder name after 'git worktree add'.
2fill in blank
medium

Complete the command to save your current changes temporarily using stash.

Git
git [1] save
Drag options to blanks, or click blank then click option'
Astash
Bbranch
Ccommit
Dcheckout
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of 'stash' saves changes permanently.
Using 'branch' or 'checkout' does not save changes.
3fill in blank
hard

Fix the error in the command to apply the latest stash.

Git
git stash [1]
Drag options to blanks, or click blank then click option'
Aapply
Bcommit
Cpush
Dpop
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pop' removes the stash after applying.
Using 'push' or 'commit' is incorrect here.
4fill in blank
hard

Fill both blanks to create a new worktree for branch 'dev' in folder 'dev-tree'.

Git
git worktree add [1] [2]
Drag options to blanks, or click blank then click option'
Adev-tree
Bfeature
Cdev
Dmain
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping folder and branch names.
Using a branch name that does not exist.
5fill in blank
hard

Fill all three blanks to stash changes, switch to branch 'test', and apply the stash.

Git
git [1] save && git checkout [2] && git stash [3]
Drag options to blanks, or click blank then click option'
Astash
Btest
Cpop
Dcommit
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of 'stash' to save changes.
Using 'apply' instead of 'pop' to remove stash after applying.