Reputation:
I was looking at apache-drill commit 3efc2eca and I realized that it is older than its parent commit 8614bae.
I have had a couple of other similar observations. How can I explain them?
Upvotes: 2
Views: 187
Reputation: 497
You can change git history with an interactive rebase, e.g.:
git rebase --interactive|-i HEAD~(number of commits)
Here is the scenario:
$ git commit -m 'Commit 1'
$ git commit -m 'Commit 2'
$ git rebase -i HEAD~2
// changing only 'Commit 1'
edit bae2ea4 Commit 1
pick 0e25612 Commit 2
$ git add .
$ git commit --amend
$ git rebase --continue
After these 'Commit 2' will be older than its parent 'Commit 1'
You should remember that you are not advised to rewrite history after your changes were published (pushed).
Upvotes: 2
Reputation: 48572
Commit history in git is rewritable. There are many ways that that could have happened. The most likely way is that the commit was rebased after it was created.
Upvotes: 4