If you find after git commit that the commit information was written incorrectly or some files were forgotten to submit, and no push has been performed after the commit, you can use git commit --amend to modify this commit
git commit -m 'initial commit' git add ./README.md git commit --amend
The above three commands ultimately only produce one commit, and the second commit command modifies the content of the first commit. http://git.oschina.net/progit/2-Git-%E5%9F%BA%E7%A1%80.html#2.4-%E6%92...
You can edit it again:
git commit --amend
Or reset it and start again
git reset --hard HEAD^
git commit --amend
commit provides a --amend parameter, which can modify the last submitted information
If you find after git commit that the commit information was written incorrectly or some files were forgotten to submit, and no push has been performed after the commit, you can use git commit --amend to modify this commit
git commit -m 'initial commit'
git add ./README.md
git commit --amend
The above three commands ultimately only produce one commit, and the second commit command modifies the content of the first commit.
http://git.oschina.net/progit/2-Git-%E5%9F%BA%E7%A1%80.html#2.4-%E6%92...