Conflict (CONFLICT) when doing git stash pop

1

I tried to save in the stash the current state of work, change to another branch, make a change in another branch, commit that other change.
Up here well.
But when I try to return to the state I had saved in the stash, it gives me a conflict.

~/t> git stash
Saved working directory and index state WIP on 2: 29f32ca noFuncionaEnvioUDP
HEAD is now at 29f32ca noFuncionaEnvioUDP
~/t> git checkout master
Switched to branch 'master'
~/t> echo cambiado > envioUDP.cpp
~/t> git add . 
~/t> git commit -m Terminado
[master b340cd7] Terminado
 1 file changed, 1 insertion(+), 1237 deletions(-)
~/t> git stash pop
Auto-merging envioUDP.cpp
CONFLICT (content): Merge conflict in envioUDP.cpp
    
asked by Jose Antonio Dura Olmos 27.02.2017 в 17:12
source

1 answer

1

It looks like you have changed the same file in both the stash and the master branch. That's why it gives you conflict.

Keep in mind that the stash pop what it does is mix the saved state with the current branch. You must return to noFuncionaEnvioUDP before doing git stash pop

    
answered by 01.03.2017 / 10:43
source