git commit --amend
CautionFix the last commit
git commit --amend
Folds staged changes into the last commit or edits its message. Coordinate if it was already pushed.
Examples
git add forgotten.txt && git commit --amend --no-editAdd a forgotten file
Syntax
git commit --amend [--no-edit] [-m msg]
Before you run it
Amending pushed commits forks history.
Used when you see
Related commands
- git commitCommit
- git rebaseRebase
- git pushPush to remote
The same reference, with no signal at all
Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.
Get it free on the App Store