I oftentimes make the mistake of making a change to a file right after a commit, then running git commit --amend
followed by a quick git push -f origin master
The issue, obviously, is that I never ran git add foo.md
. So my amend didn't actually amend any of my committed code.
Question is: Why doesn't git warn you when amending a commit with no changes? Better yet, why does it even complete successfully? Is it merely behaving like a "touch" in changing the timestamp of a given commit?