Re:Key Git Concepts Explained the Hard Way
by coldacid on Wednesday March 14, 2018 @08:16PM
(#16589533)
>Because no one has needed it enough to add it.
Or because those that did need it whipped up a quick and dirty alias to cover that use case.
Because the working tree having uncommitted changes being blown away would be terrible data loss or a conflicting merge, so when that could happen, git prevents it.
Use `git stash` to stash your uncommitted changes before switching branches and you'll no longer have data loss.
If you want to apply those changes again use `git stash pop`.
If you don't want those changes use `git stash drop`.
Why isn't there a commandline option to checkout a branch and do a stash operation at the same time?
Because no one has needed it enough to add it.