Skip to main content

Command Palette

Search for a command to run...

Squashing commits to single commit

Published
1 min read
S

I love learning about technology and sharing that with others

Motivation

while doing the merge when there are multiple commits it is a good practice to combine your local changes into one commit so that it is easier for the person who is doing the merge

command :

git rebase -i HEAD~3

this will open a window with the commits , just add

squash

in front of the commits message to commit into one , just add the squash

after that save the editor and close it

now new editor will open with the commits message

there you can add any commit and that commit will be the final commit of all the three changes.

10 views

More from this blog

H

hashcodehub

271 posts

Consistent, Passionate and Organized :)