Use the selected commit message without launching an editor. For example, git commit --amend --no-edit amends a commit without changing its commit message. Replace the tip of the current branch by creating a new commit.
On the command line, navigate to the repository that contains the commit you want to amend. Type git commit --amend and press Enter. In your text editor, edit the commit message, and save the commit.
It is recommended not to use amend if you have already pushed the changes to remote and other developers have already started using those changes.
The git commit –amend command lets you modify your last commit. You can change your log message and the files that appear in the commit. The old commit is replaced with a new commit which means that when you amend your old commit it will no longer be visible in the project history.
Try git commit --amend --no-edit
.
This will amend the latest commit, using that same message, in one command:
git commit --amend -C HEAD
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