Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to apply same stash to different branches in git?

I have four branches lets say A B C D.

I worked on branch B for some function and created stash.

This feature I also want in branch A and D .

Is there any way that I can use this stash from B and apply to A and D also and definitely I want it on B too that's why I don't want to commit instantly and go for stash.

like image 362
coder007 Avatar asked Dec 07 '22 16:12

coder007


1 Answers

git checkout A
git stash apply
git checkout D
git stash apply

Git won't delete your stash until you call git stash drop, so feel free to apply it to as many branches as you like!

like image 58
beaumontwebdev Avatar answered Dec 11 '22 09:12

beaumontwebdev