DEV Community

Discussion on: 🚀 One Git Trick for Perfect Commits 🛠️

Collapse
 
sumanthlingappa profile image
Sumanth Lingappa

Doesn’t this change the commit history?
If I want to change the commit message of an older commit, then all the commit history later to the changes commit will be changed. Please correct me.

Collapse
 
0ro profile image
0ro

Thank you for your question. Yeah, you are absolutely right, rebase command changes the commit history, and this is why later you need to push your changes with a --force flag. Technically with rebase --autosquash all of your commits will be just copied and the fixup commit will be squashed into another commit so your git history will only look like the same, but with different ssh-hashes