I have a repository with a single (master
) branch:
a > b > e > f > g > c > d
It turns out that I need the changes in c
and d
(two commits toward the end of the history so far) to occur earlier, so that I’d have:
a > b > c > d > e > f > g
Everything’s been pushed. I understand I’m not supposed to rebase pushed commits, so what can I do?
You cannot reorder pushed commits without git push -f
. If this repository is shared between you and other guys, then you shouldn't do anything. If this is your own repo or it's on your own branch, use git rebase -i <hash of a>
, then reorder the commits as you want, then git push -f
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With