What it means
Git refuses to throw away uncommitted work. You need to commit it, stash it, or discard it first.
Causes and fixes
Most likely first. Run the check, and if it matches, apply the fix.
1. Uncommitted edits to files that differ on the other branch
Check:
git status
Fix: git stash (then git stash pop on the right branch), commit on a branch, or git restore <file> to discard.
Fix it yourself
A live machine in your browser with this problem already on it. The grader checks the result.
- Pause Your Work for an Urgent Hotfixmedium 6 min
- Stash Only Part of Your Changeseasy 6 min
- Hotfix in a Second Worktreemedium 7 min
No account needed for your first tries.