the failed auto merge happens because you modify the same file on both that
saved in the stash and in b2 which you merge prior to popping the stash.

When git want to apply changes that recorded in the stash, git found that
the file has changed since the last time you do a git stash so git can't
apply the changes cleanly thus the failed auto merge.

In that case after doing 'git stash pop' you just need to resolve the
conflict, doing 'git status' will tell you which files that has conflict in
them and then you just need to decide which changes are the 'correct' one.
Git make this easier for you by marking the conflicted part with '<<<<<<'
and '>>>>>>'.

After you've done with the conflicted files just save them and do a 'git
stash drop' to remove the merged stash and you'll be green again.
On Mar 4, 2013 11:37 PM, "Konstantin Khomoutov" <
flatw...@users.sourceforge.net> wrote:

> On Mon, 4 Mar 2013 06:59:56 -0800 (PST)
> Surya <kasturisu...@gmail.com> wrote:
>
> [...]
> > For testing, I took 1 single file.
> > created a branch b1.. edited it. Instead of staging, I stashed...
> > then checked out master
> > then created b2 branch
> > edited the file again (different data).. this time, staged-& did
> > commit.. checked out master, and merged branch b2.
> >
> > Now, I went back to b1.
> > did stash pop
> > now I see
> >
> > Auto-merging conflict
>
> Impossible.  You must have had some other changes on b1 compared to its
> state at the time of recording that stash record.
>
> A stash entry contains changes relative to the base version which was
> checked out at the time you recorded that entry (in other words, what
> HEAD pointed to at the moment).  So when you apply these changes to
> *the same* base version, they are guaranteed to apply cleanly.
>
> So supposedly you updated b1 as well after recording your stash or did
> something like this.
>
> --
> 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.
>
>
>

-- 
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