duhan
Blog

Include New Changes in Your Latest Commit

Most of the time I work alone on my side projects. I have my own reasons to work that way. But this issue bothering me all the time: I often forget to add something to my last commit.

One solution to this is to make a good plan before starting the project. Still, we can make mistakes. There is another solution to this: git commit --amend --no-edit

Let’s imagine you have made your changes and commited to local repository, but you didn’t push and realized you should have updated the version number. Kindly edit your version number and run:

git add .
git commit --amend --no-edit

Now your updated version number is included in your latest commit.