0
0
Gitdevops~5 mins

Worktrees vs stashing decision in Git - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What is a Git worktree?
A Git worktree is a separate working directory linked to the same repository, allowing you to work on multiple branches simultaneously without switching branches in one directory.
Click to reveal answer
beginner
What does 'git stash' do?
Git stash temporarily saves your uncommitted changes so you can switch branches or work on something else without committing those changes.
Click to reveal answer
intermediate
When should you use a worktree instead of stashing?
Use a worktree when you want to work on multiple branches at the same time with separate folders, avoiding the need to stash and unstash changes repeatedly.
Click to reveal answer
intermediate
What is a limitation of using git stash?
Git stash only saves changes temporarily and can be forgotten or lost if not applied; it also requires switching back and forth between branches to apply changes.
Click to reveal answer
intermediate
How does using worktrees improve workflow?
Worktrees let you keep multiple branches checked out in different folders, so you can test or develop features side-by-side without interrupting your main work.
Click to reveal answer
What is the main benefit of using git worktrees?
AWork on multiple branches at the same time in separate folders
BTemporarily save changes without committing
CDelete branches safely
DMerge branches automatically
What happens when you run 'git stash'?
AA new branch is created
BYour branch is deleted
CYour changes are saved temporarily and removed from the working directory
DYour repository is cloned
Which scenario is best suited for using git stash?
AQuickly saving changes before switching branches
BWorking on two branches at the same time
CCreating a new repository
DDeleting untracked files
What is a downside of relying only on git stash?
AIt creates multiple folders automatically
BChanges can be forgotten or lost if not reapplied
CIt merges branches without conflicts
DIt commits changes permanently
How do git worktrees affect your file system?
AThey delete your current folder
BThey merge all branches into one folder
CThey compress your repository
DThey create additional folders for each checked-out branch
Explain when you would choose to use git worktrees instead of git stash.
Think about how you manage multiple tasks or projects at once.
You got /4 concepts.
    Describe the main purpose of git stash and a limitation you should be aware of.
    Consider stash like a temporary drawer for your work.
    You got /4 concepts.