{"thread":{"id":"39119","subject":"git stash merge","startedAt":"2015-04-20T16:36:02Z","lastAt":"2015-04-20T18:12:50Z","messageCount":2,"participants":["Pawel Por","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"259682","messageId":"CAJmOuEwEgA-9NCtBXjij-rLhsCWMyw+DcRVGo4=0b1V2nC==cA@mail.gmail.com","threadId":"39119","inReplyTo":null,"subject":"git stash merge","fromName":"Pawel Por","fromEmail":"porparek@gmail.com","sentAt":"2015-04-20T16:36:02Z","receivedAt":"2015-04-20T16:36:02Z","isPatch":false,"sender":{"key":"porparek@gmail.com","avatar":null},"body":"Hi,\n\nI've just upgraded the linux kernel git source tree and I want to\n\"pop\" my stashed work. I do the following:\ngit stash pop\n\nand I got the following message:\nmm/Makefile: needs merge\nunable to refresh index\n\nI also tried:\ngit stash pop --index\n\nHow can I overcome this obstacle.\nI did \"git stash\" before \"git pull\".\n\n\nThanks for help.\n"},{"id":"259688","messageId":"xmqqy4lmllct.fsf@gitster.dls.corp.google.com","threadId":"39119","inReplyTo":"CAJmOuEwEgA-9NCtBXjij-rLhsCWMyw+DcRVGo4=0b1V2nC==cA@mail.gmail.com","subject":"Re: git stash merge","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-04-20T18:12:50Z","receivedAt":"2015-04-20T18:12:50Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pawel Por <porparek@gmail.com> writes:\n\n> I've just upgraded the linux kernel git source tree and I want to\n> \"pop\" my stashed work. I do the following:\n> git stash pop\n>\n> and I got the following message:\n> mm/Makefile: needs merge\n> unable to refresh index\n\nThe symptom indicates that \"upgraded the linux kernel git source\ntree\" has not been cleanly completed and has an unmerged entry in\nthe index.  That is the first thing \"stash pop\" tries to check that\nthe source tree does not have any pending change that does not have\nanything to do with your application of the stash, and you seem to\nbe triggering that safety check.\n\nIf your working tree does not have changes of any value, perhaps\n\"git reset --hard && git pull\" (or you may even want to resort to\n\"git fetch && git reset --hard origin\") to make sure \"upgraded the\nsource tree\" part truly has cleanly completed may be a good second\nstep to get \"stash pop\" going.  The good first step is to see what\nlocal changes you have, of course---perhaps your \"upgraded the linux\nkernel git source tree\" conflicted with your local changes that you\nneed to resolve first.\n"}]}