Skip to content

Latest commit

 

History

History
17 lines (15 loc) · 601 Bytes

File metadata and controls

17 lines (15 loc) · 601 Bytes

2. Modify the Last Commit

You have committed to your local Git Database. Thereafter you realize that you have forgotten to include file changes to that commit(you may have not saved the file). Or you add a new file that you want it tied to the same commit you have committed most recently.
Git can unlock the previous commit and allow you to add your new file.

Just do this:
First, you add the missing file using:
git add newfile.ts
Then, run:
git commit --amend --no-edit
The --no-edit flag amends the commit without changing the commit message.