0

I am a little bit confused.

I have a develop-branch (local and remote) and branched of a feature branch from it (only local). I did several commits to finish that feature and then merged the feature branch back into that develop branch. History looks fine. Feature commits were still in the feature branch plus one merge commit to develop.

Now, I wanted to be on the save side and ran a 'git pull origin' on my develop branch (before pushing my work). The result is: the merge commit disappeared and I got duplicates (by content, not by SHA-1) of my feature commits on top of the last develop commit. The feature branch looks like not merged back (no connection back to develop).

Now, I am pretty lost and don't know what to do and what was wrong with that pull...

Antje Janosch
  • 1,154
  • 5
  • 19
  • 37
  • 3
    It sounds like you set things up to do a "rebase" when pulling, so that all your changes get applied on top of the new origin head. But your feature branch is still there, so you can redo it (as long as you did not push the rebased stuff back upstream). You could for example reset your master to before the start of the feature branch, do another pull (to get the latest head), do your merge, and then push that. – Thilo Oct 07 '15 at 11:50
  • first question: is this a kind of configuration setting for the 'pull' which is set to do a 'rebase'? if yes, how can I change that. How should that look like? – Antje Janosch Oct 07 '15 at 11:55
  • second question: I would need to set the HEAD of develop back to the last develop commit and then redo the merge? – Antje Janosch Oct 07 '15 at 11:56
  • configuration: http://stackoverflow.com/a/15935584/14955 – Thilo Oct 07 '15 at 11:58
  • yes, point your develop to exactly where origin/develop is. Then do your merge again. Then avoid rebasing it a second time. Whatever you do, don't lose that private feature branch with all your work before you are satistified that all has been pushed in a form that you approve of. – Thilo Oct 07 '15 at 12:00
  • 1
    personally, I avoid `git pull`. I do `git fetch`, look at what that gave me in the history tree view, followed by explicit merge or rebase. – Thilo Oct 07 '15 at 12:02
  • Thanks a lot! I could solve it with a 'git reset', then redo the merge and then I used the 'git fetch' (actually there was nothing to fetch) before I pushed my work. Clean history now :-) – Antje Janosch Oct 07 '15 at 12:26

0 Answers0