How to merge rebased branch properly?

Lukast dev lukast.dev at gmail.com
Sat Sep 14 09:28:46 BST 2013


Hello,

thanks DmitryK, I tried your advice. The problem occured when I did

git pull --rebase

There many conflicts arised due to duplicated commits.
So I did
git rebase --abort and
git rebase -i

and I dropped all the duplicated commits and pushed.I did not squash the
commits, I'm sorry about that. Next time I will
be more careful -- this way I'm sure no other commits of others are lost.

Lukas


2013/9/8 Dmitry Kazakov <dimula73 at gmail.com>

> Hi, Lukas!
>
> The only problem of a rebasing a pushed branch is that you cannot push it
> again due to non-fast-forward-merge. If your commits are not destroyed by
> the rebase (that could happen with merge commits actually) you can still
> push them into repository, but under a different HEAD.
>
> So to do that you should:
>
> 1) git checkout krita-gmic-ltvrdy # checkout to your rebased branch
> 2) git checkout -b krita-gmic-ltvrdy-2nd-try # create a new branch, so
> that no conflicts would happen
> 3) git push origin krita-gmic-ltvrdy-2nd-try
>
> After that, if you think you commits in the branch are ok and bisectable,
> you can merge this branch to master as usual.
>
>
>
>
> On Sun, Sep 8, 2013 at 2:42 PM, Lukast dev <lukast.dev at gmail.com> wrote:
>
>> DmitryK mentioned some other possibility to preserve history, to create
>> another branch and merge that new branch.
>>
>> I would like to preserve the commits as I dropped some code that might be
>> needed again and squash will destroy history
>> of the branch.
>>
>> Dmitry,can you explain the solution with more details (git commands
>> ideally)? What should be done to preserve history and have easy merge?
>>
>> Lukas
>>
>>
>> 2013/9/7 Cyrille Berger <cberger at cberger.net>
>>
>>> Yes, never rebase commits that have already been pushed (git should not
>>> even let you do that), and yes the calligra policy is to merge-squash.
>>>
>>> --
>>> Cyrille Berger Skott
>>> ______________________________**_________________
>>> calligra-devel mailing list
>>> calligra-devel at kde.org
>>> https://mail.kde.org/mailman/**listinfo/calligra-devel<https://mail.kde.org/mailman/listinfo/calligra-devel>
>>>
>>
>>
>> _______________________________________________
>> calligra-devel mailing list
>> calligra-devel at kde.org
>> https://mail.kde.org/mailman/listinfo/calligra-devel
>>
>>
>
>
> --
> Dmitry Kazakov
>
> _______________________________________________
> calligra-devel mailing list
> calligra-devel at kde.org
> https://mail.kde.org/mailman/listinfo/calligra-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20130914/51a54d91/attachment.htm>


More information about the calligra-devel mailing list