Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git stash pop with binary - merge conflict

I'm trying to do a "git stash pop" with a binary file. It results in a merge conflict. I just want to pull what's in the stash off and overwrite what's in the working directory. What is the easiest way to do that?

like image 829
Mr Mikkél Avatar asked Apr 30 '15 22:04

Mr Mikkél


People also ask

How do I resolve stash merge conflict?

The stash entry is kept in case you need it again. There's no magic remedy for such merge conflicts. The only option for developers is to edit the file by hand and keep what they want and dispose of what they don't want. Once they merge and save the file, they will have effectively resolved the git stash conflict.

Does git stash apply pop?

git stash apply vs pop : They are almost similar except the fact that git stash pop throws away the (topmost, by default) stash when applying it, whereas git stash apply leaves it within the stash list for possible later use (or you'll then git stash drop it).

What do I do after git stash pop?

The key difference between git stash pop and apply involves the stash history. When a developer uses the git stash apply command, the most recently saved stash overwrites files in the current working tree but leaves the stash history alone. In contrast, the pop command restores files but then deletes the applied stash.


1 Answers

To restore all files to their stashed version:

$ git checkout stash -- .
like image 97
Alex Pan Avatar answered Oct 17 '22 19:10

Alex Pan