Last Updated: October 11, 2021
·
1.029K
· asimabdul

Git - adding forgotten files to a commit

If you have new and modified files to be added and committed, using

git commit -am "commit message"

is going to ignore the new files.

To avoid doing another commit, stage the files for a commit and do a

git commit --amend

This will bring up a text editor where you can edit the commit message. Close this and your working branch is clean.

1 Response
Add your response

Note, you can also use --amend to fix typos or improve commit messages without committing any changed files

over 1 year ago ·