actually what are you trying to do?, the subject says something with stash,
and then you talk about merging... seems like i do not undertand the
problem at all...

maybe when you do a stash pop, you have conflicts?, if so....

that is a common problem

when you make a stash, actually records in what commit you did that stash,
this guarantees that making pop it that commit wont fail into conflicts...

conflicts happens when you stash, make changes, commit, (pull, etc), and
then you try to stash pop... that can fail for obvious reasons... code
incompatibility etc...

the solution is to checkout to the commit where the stash was created
(using checkout, git reset --hard, or using gitk --all), and then create a
new branch from there....

once you have this new branch, you can safely make a stash pop because in
that commit was created..

then you return back to your previous branch and do a merge if needed....
git merge master temporalbranch

Afortunately, git provides a single command to do this, if you read the
manual (git help stash) it says...

------------------------------------------------------------------------------------------------------------------------------------------------------
branch <branchname> [<stash>]
           Creates and checks out a new branch named <branchname> starting
from the commit at which the <stash> was originally created, applies the
           changes recorded in <stash> to the new working tree and index.
If that succeeds, and <stash> is a reference of the form
           stash@{<revision>}, it then drops the <stash>. When no <stash>
is given, applies the latest one.

           This is useful if the branch on which you ran git stash save has
changed enough that git stash apply fails due to conflicts. Since the
           stash is applied on top of the commit that was HEAD at the time
git stash was run, it restores the originally stashed state with no
           conflicts.
------------------------------------------------------------------------------------------------------------------------------------------------------

so, anytime you cam make: git stash branch temporalbranch

and then simply... git merge temporalbranch

hope this helps

bye!

-Joe


2013/5/8 Yawar Amin <yawar.a...@gmail.com>

> Hi,
>
> On Friday, March 8, 2013 4:06:04 PM UTC-5, Piers H wrote:
> > why does git require all these gymnastics just to do a simple merge?
> > with SVN it was 1 command, and I never had any issues with it. i don't
> > understand.
>
> You'll need to adjust your workflow a little bit. Git has a different
> philosophy from Subversion, you need to adapt mentally. It's not a great
> hardship.
>
> Do your local work and commit it. Don't leave any files out of the
> commit(s) if you need them. Commit everything you can.
>
> Then, do a git pull. If this causes a merge conflict, you can solve it
> like any other merge conflict, in a sane way.
>
> No need to stash your changes.
>
> Regards,
>
> Yawar
>
>  --
> 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