I want to combine two commits that are out of order.
For example, if I execute the command git rebase -i HEAD~3:
pick 8h47n1f Update documentation and release-notes
pick 8n32b7a Implemented some random function
pick a73ncj1 Update documentation and release-notes
I want to combine the lines a and c into one commit before pushing.
My current way to accomplish this is to reorder my commits as follows:
pick 8h47n1f Update documentation and release-notes
squash a73ncj1 Update documentation and release-notes
pick 8n32b7a Implemented some random function
So far, I have not seen any dangerous side effects. Does anyone know if I can really break something by doing this? Is there a better, safer way to do what I'm trying to accomplish?
source
share