Git stash isn’t optimal for switching branches but is beneficial for breaking down commits which promotes better commit hygiene and facilitates code reviews.
Each commit should tell its own story with one functional change at a time, allowing easier code reviews and enabling the reversion of smaller change sets.
When functionality is intertwined and git add -p isn't sufficient, git stash serves as a reliable backup, allowing staged changes to be applied separately.
Using git stash with --include-untracked saves local changes, including new files, enabling a clearer workflow to break down changes into separate commits.
Collection
[
|
...
]