V
V
VicTHOR2021-04-23 13:19:18
git
VicTHOR, 2021-04-23 13:19:18

How to rebase if there was a pull?

There are 2 branches (conditionally feature and develop)
The feature branch was started from a certain commit in develop.
The develop branch was updated and a git pull was made. Conflicts arose, conflicts were resolved, and so that the commit was not a simple "merge develop into maturity", then some functionality was made and git commit --amend.

Now there is a need to do a git rebase, but an error occurs on that commit

error: commit {hash} is a merge but no -m option was given.

reabse interactive. What to write in the file and do to make this commit independent?
develop                feature

       * нужно сделать rebase сюда
       |
       *              *
       |              |
       |              * проблемный pick
       *          /   |
       |       /      |
       |   /          *
       *              |
       |              *
       *           /
       |       /
       |   /
       *

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VicTHOR, 2021-04-26
@VicTHOR

In the todo file of the problematic commit, you can write not pick <commit-hash>, but exec git cherry-pick -m 1 <commit-hash>.
Because I had more commits with merge and I needed to make a fixup (add changes to the previous commit without a commit), and fixup also cursed that the commit was a merge, I made a new branch and manually sorted everything through cherry-pick.
Thanks to WbICHA and Lynn "Coffee Man" for the tip.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question