MANDATORY: Always run git status --porcelain before any git operation that affects the working tree.
Users may have valuable uncommitted changes from previous sessions. Before running git checkout, git switch, git merge, git rebase, git reset, or git clean:
- Run
git status --porcelain - If the output is non-empty — stop and inform the user. Do not proceed.