Duplicate commits, clean up commit history #23930
-
This is not a mission critical issue. But, I made a mess out of a development branch. I checked out a new branch from another non-master branch. I renamed the new branch because of an sdk update. Merged in individual commits…I want to clean up the log. Eventually, the dev branch will become master.
This is a mess of my own making. Since I am a solo developer, I use a mix of merge, Appreciate suggestions. Thank you. lrzip-next beta branch |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
In principle, this can all be done with an interactive rebase: You can delete, reorder, or change commits. You can find a detailed description here: Git - Rewriting History Note that depending on the details messing with the order of commits can lead to conflicts, e.g. if you delete a duplicate commit and then one of the commits after doesn’t fit right. |
Beta Was this translation helpful? Give feedback.
-
Thanks again. The two FIX commits are identical and contain one file and one line of change. The merge messages appear empty. I forgot to use |
Beta Was this translation helpful? Give feedback.
-
So I decided to ignore any mess in temporary or dev branches. I can just copy over the needed files or do a very selective merge. There are some forks out there and I don’t want to mess downstream up. |
Beta Was this translation helpful? Give feedback.
In principle, this can all be done with an interactive rebase: You can delete, reorder, or change commits. You can find a detailed description here: Git - Rewriting History
Note that depending on the details messing with the order of commits can lead to conflicts, e.g. if you delete a duplicate commit and then one of the commits after doesn’t fit right.