I had two branches, independent. I worked on them at different points for a month. I went to merge one branch (call her apple ) to another (call her orange ), check the orange color and make git merge --no-ff apple , and everything went well. In gitk, I could clearly see that each branch had its own story, and it was combined with the fixation of the merge in orange.
Later I understand that the fixation in the orange is wrong, there is an error during the assembly process, and I have to edit this early message on the orange. I am using git rebase -i HEAD~19 , select commit and change pick to edit . So I edit the commit and everything is fine, and I finish rebase. I go back to gitk and the whole story of two branches is one linear story in orange.
So did I mess up something, or is it the way it should be? I used git reflog to go back to when I did the merge, then I did another reset to go back before the merge in orange, then I did the permutation and fixed it, after which I did the merge. Now everything looks the way I expect when commits from branches are not intertwined.
For future reference, can someone tell me how I can reinstall the commit on a branch where I merged into another branch without ending with interlaced commits (linear history)?
If my terminology is incorrect, feel free to edit it. Thanks again
source share