Plus, now you need to use `git diff origin` rather than `git diff` to see your changes.
No. rebase -i goes in the reflog. stashes don't. The rebase man page does not have the same safety warning that the stash man page does. I have personally witnessed a lot of stash accidents, and not many rebase accidents.
With a rebase, if you have a bad merge conflict, you can abort. With a stash you can't. If you've committed your changes and have problems either forgetting what you're doing, or with merge conflicts, or with being in the wrong branch. All of these cases have more undo options with commits. In the worst case, you still have the safety net of the reflog with commit. With stashes, your only safety net is hunting for dangling blobs using fsck.
Previous threads: https://news.ycombinator.com/item?id=12613062 https://news.ycombinator.com/item?id=12622414
Of course you can! Git stash is not necessary for any workflow, it's pure convenience.
Best practice is not to pull with unstaged changes. If you want to, then:
Easier than stashing! But this does mean you're going to need to rebase -i later before you push.Stash is dangerous for beginners, I don't recommend learning it first. From the stash man page:
"If you mistakenly drop or clear stashes, they cannot be recovered through the normal safety mechanisms." https://git-scm.com/docs/git-stash