git log
output shows newer entries first:
+>git log --oneline
0614cce adding d
8bcf445 adding b AND c
1fce972 adding a
Whereas if I do git rebase -i HEAD~2
, the interactive editing file shows commits with oldest first:
1 pick 8bcf445 adding b AND c
2 pick 0614cce adding d
3
4 # Rebase 1fce972..0614cce onto 1fce972
5 #
6 # Commands:
7 # p, pick = use commit
8 # etc...
What's the motivation for this decision?
It shows the commit in the order it will apply them on top of a commit.
It applies those from the oldest to the newest.
You can then (with an interactive rebase) change that order, drop some commits entirely, or squash commits together.
Note: be careful if your git log
is during a reword of an interactive rebase: see "git rebase -i
shows wrong commit history after a rebase and force push".
Use Git 2.24+ (Q4 2019).
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