I made few changes in local master branch. The local changes were not staged (added). In order to update the master branch, I did the following:
I see that after this the local changes get staged (added) ? Shouldn't they be kept unstaged as they were before.
git stash
is essentially the same as git commit
. It creates a fully fledged commit, but doesnt add it to the history. Instead, it adds the commit to the stash.
Therefore, git stash
has to make a choice: Either commit (stash) all the uncommited changes, or only commit (stash) the ones that are added to the index. It can't do both. That would take two commits instead of one.
AFAIK, git stash
takes all uncommited changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With