On Sunday, March 3, 2013 5:25:30 PM UTC-5, Konstantin Khomoutov wrote:
> On Sun, Mar 03, 2013 at 11:56:10AM -0800, Tom Green wrote: 
> > > I did a GIT STASH (working in Windows command line). Now I can't 
> restore 
> > > from it 
> > > I get the message: 
> > >     TECHNOTE/git.TXT: needs merge 
> > >     unable to refresh index 
> [...] 
> > Thanks, Konstantin. How do I go about merging that one file in my stash 
> > into my working directory so I can proceed? 
> Are you sure you *understand* the situation with your project? 
> I don't mean/want to offend you, but your original message gave me the 
> impression you have little to no clue about what's going on and why 
> `git stash apply` refuses to work.  From the error message, I gathered 
> that your index most probably contains unmerged entries which means 
> you're in the middle of a merge which had conflicts (which you did not 
> yet solve).  To know for sure, I proposed to check the output of the 
> `git status` command, to see if you really have merge conflict in 
> the "TECHNOTE/git.TXT" and other affected files. 
> Now you tell nothing about what you did about it and ask me how to merge 
> a file in a stash into the working directory.  This unfortunately makes 
> me think I probably failed to convey my idea about the situation or you 
> failed to understand it. 
> So let's recap: 
> 1) It appears to me that you're in the middle of a faulty merge 
>    operation.  This means you have unresloved conflicts in certain 
>    files. 
> 2) `git stash pop` fails to update those files. 
> 3) So you have to first deal with the merge and make sure your work 
>    tree is clean (has no local modifications) and matches the index. 
> 4) To verify (1) holds true, you should start with inspecting 
>    what `git status` tells you. 
> I understand it's possible that you're very well aware about what state 
> your project in, and you just did not tell me.  But I want to be on the 
> safe side to not damage your data so please bear with me and consider 
> really providing answers to what was asked or we'll go round in circles. 
> And no, AFAIK, there's no way to merge a stash entry into the work tree, 
> let alone a single file from it.  Well, the truth is, I can imagine a 
> couple of ways to go about doing this but let's first deal with what I 
> think is the real problem. 
Thanks again, and for some reason -- not sure exactly what did it -- the 
files are back in my working directory. So my problem is resolved, but I 
would still like to understand. Anyhow, the urgency is gone.  You're right, 
I'm new to GIT, so I'm not offended by anything. 
I did a GIT STATUS and saw the same file as unmerged. It said that I needed 
to resolve conflicts, but I didn't understand how to do that. I'm not sure 
if this did it, but I edit the file and removed the lines with "<<<<<<< 
Updated upstream" and ">>>>>>> Stashed changes" and saved it. 
  - Does GIT look for the ">>>>>>>" markers in the file to see if I 
resolved the conflict? 
  - Or does it somehow check the file date?
  - Or am I barking up the wrong tree completely?
After that the GIT STASH POP seemed to work. <shrug shoulders>  So now I 
can get back to my real work.
Also, another stupid question:
  - Does the term INDEX refer to what GIT-GUI calls STAGED CHANGES?
The top of my tree (from GITK) looked roughly like this.
*  Local uncommitted changes
*  Saving GIT.TXT so I can un-stash
|    * STASH   WIP on Master... Commit xyz  (I don'r remmeber doing this)
|  /
|    * index on master 090ecd0  Commit xyz
|  /
* Commit xyz
Anyhow, thanks again for your help. Something worked.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to