The git book seems to contradict itself re git commit --amend
:
This command takes your staging area and uses it for the commit. If you’ve made no changes since your last commit..., then your snapshot will look exactly the same and all you’ll change is your commit message.
First it says, "This command takes your staging area and uses it for the commit."
Now, if I run git add -A; git commit -m "Initial"; git status;
the status message says the staging area is empty.
Then the book says, "If you've made no changes since your last commit ... your snapshot will look exactly the same..."
Now, if it uses my (empty) staging area for the commit, shouldn't the amended commit be empty? The amended commit isn't empty though, it includes the files that were in the last commit.
It seems that the git book should read:
This command takes your staging area, adds it to the last commit, and creates a new commit from the combination...
Please help me out here. What, if anything, am I missing?