DEV Community

hmble
hmble

Posted on • Originally published at hmble.dev on

How to add changes to previous git commit ?

Unsplash image
Photo by Rod Long

Sooo aapne koi changes commit kiye aur ab aapko us commit me aur changes add karne hai, well lets use magic of git.

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

Explanation

This command adds staged changes to previous commit without editing commit message.

NOTE :
Previous commit me changes amend karne se us commit ka <sha> change hota hai.


I know this is a short blog but I am trying to keep myself consistent to write a blog each day. I'll be glad if mai aapki help kar paaya to.

Feel free to say hi @hmbledev

Top comments (0)