DEV Community


Posted on

How to commit minor changes into a previous commit (changing history of repo)?

If you have a minor change for which you don't want to create a new commit. Use

git commit --amend --no-edit
Enter fullscreen mode Exit fullscreen mode

This will allow you to create a new commit but replace the older one. But it will appear as if the old commit was never created. If you need to give a new message use -m flag to give a new message.

Discussion (0)