Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
The Secret Power of `git stash --include-untracked`
February 2, 2026
Ever needed to switch branches quickly but had messy, untracked files (like logs or temporary config) cluttering your workspace? Standard `git stash` only saves tracked changes, leaving those new files behind. To truly clean your directory, use `git stash push -u` (or the longer `--include-untracked`). This ensures your new, uncommitted files are bundled up with your tracked modifications, leaving your working directory pristine. It saves you the headache of manually deleting temporary files before a quick context switch.