I have stash_one as stash@{1} and stash_two as stash@{2} . now if i do
git stash apply stash@{1} then on my editor i will have all the changes which was in stash_one.
But when i do git stash apply stash@{2} , then it says
Please commit your changes or stash them before you merge.
I dont want to merge it . I want to apply stash_two also , So that I can see both the changes of stash_one and stash_two at once. How can I do it?
You can do the following for as many "stashes" as you have. The trick is to do git add . after each "pop" or "apply"
git stash apply stash@{1}
git add .
git stash apply stash@{2}
git reset .
You can reset single files from staging area with git reset <file> instead of resetting all files with git reset .
You can also use git stash pop for as many "stashes" as you have. In this case two stashes means two pops like:
git stash pop
git add .
git stash pop
git reset .
You can consider committing each of them and then doing a squash with git rebase follow by a git push.
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