Easiest way of squashing multiple commits into one with GIT

Saurabh Shubham
1 min readJun 13, 2018

--

For viewing the commit’s history:
git log : with details
git log --oneline : without details

For setting up sublime as the default editor for graphically modifying the changes:
git config --global core.editor "subl -n -w"
Note: In windows you have have to set PATH for sublime.

For rebasing the commits(say last 4):
git rebase -i HEAD~4

Now replace pick for each commit you want to squash with fixup or squash as per the usefulness in the sublime window opened.

After this save and exit the sublime.

(Optional) For amending the commit name:
git commit --amend -e : Save and exit

Squashing Accomplished.
Thank You.

--

--

Saurabh Shubham
Saurabh Shubham

No responses yet