You have uncommitted changes in your current branch. What happens if you run git checkout feature-branch?
Think about how Git protects your work when switching branches.
Git prevents switching branches if you have uncommitted changes that would be overwritten. It shows an error to protect your work.
You want to work on two branches at the same time without losing your current work. Which Git feature allows you to save your changes temporarily and switch branches?
It saves your changes away temporarily so you can come back to them later.
git stash saves your uncommitted changes so you can switch branches safely and reapply them later.
Which command creates a new branch named hotfix and switches to it immediately?
Look for a single command that does both actions.
git checkout -b hotfix creates and switches to the new branch in one step.
You try to switch branches but get a conflict error because of uncommitted changes. What is the best way to resolve this so you can switch branches safely?
Think about preserving your work safely.
Committing or stashing your changes saves them so Git can switch branches without losing work or causing conflicts.
You have multiple feature branches and want to keep them updated with the main branch changes. Which workflow is best to avoid complex conflicts?
Think about keeping your work current and conflicts small.
Rebasing feature branches regularly onto main keeps them up to date and reduces complex merge conflicts later.