While working today, i forgot to stage some unstaged files before creating a commit. After staging with git add -A
, I wanted the staged files to be included to the previous commit.
git commit --amend --no-edit
to the rescue.
Running the command will quietly include any staged files onto the last commit you created, re-using your existing commit message.
Note: this will only work so as long as you haven’t git push
yet.
For more Git command tips, see Lesser known Git commands
La Fin!