Answer the question
In order to leave comments, you need to log in
Git: how to export commits?
Hey!
I want to correct the consequences of my crooked hands.
There is a turnip with N branches. Development velast in all branches and from time to time merged together. However, instead of merging, I shoved and pulled. As a result, the development history looks crappy. If you look at gitk, then instead of beautiful branches and horizontal links between them, there is some kind of spaghetti. Can this be fixed? Let's say, somehow export all the commits, starting with the first one, and then manually roll them in order, diluting them with merges. There are only 20 commits, it shouldn't be hard. Tell me the recipe?
Answer the question
In order to leave comments, you need to log in
There are many tools in the git for this... the most correct one, perhaps, is
Either make a branch from one of the initial commits, when everything was still good, and gradually merge into it the commits from the "dirty" one with the key --squash. Or cherry pick .
Either generate patches
then apply
git am < file.patch
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question