4 ms·
TIL about `git read-tree`. Thanks! I think it will prove very useful for me. That said, the easiest way to reorder commits is to `git rebase -i $some_base` a
by cryptonector 5y ago
TIL about `git read-tree`. Thanks! I think it will prove very useful for me. That said, the easiest way to reorder commits is to `git rebase -i $some_base` and then reorder the `pick` lines in your $EDITOR into the order you want.
> In git, every commit is a snapshot and not a delta. (Repeat that three times.)
Yes, but every commit also is notionally a delta. That the delta is reconstructed as needed is not terribly important. It's best to accept a commit as both, a reference to a state of the world, and as a delta to the recorded parent(s).
Lastly, I avoid `git reset --hard`. I often have extant changes that I don't want to lose. Instead what I do is `git rebase -i --autostash`.