I wonder is that possible to show diff between two commits one of what is amend ? In other words does git save amended commits in history somewhere?
An amended commit is no different than any other commit. In that sense it is perfectly possible to diff between a 'normal' commit and a commit that was amended.
In other words does git save amended commits in history somewhere?
There is not some list that holds all the commits that were amended, no. Amended commits are in the history just like all other commits.
When you amend a commit, it basically gets removed and replaced by a new one (it also gets a new commit hash) that has the changes from the original commit + the amended changes.
In the git reflog
you can see your recent actions, and that does show the amending of commits. References from there can be used to for example undo a git commit --amend
. Also see How to undo "git commit --amend" done instead of "git commit" for more details about that.
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