Learning Git: How to Squash Commits

Learning Git: How to Squash Commits

Intermediate Git tutorial video

Our latest video in the Learning Git with GitKraken series is about squashing commits. In 90-seconds, you’ll learn what it means to squash commits in Git, and you’ll see how easy it is to squash commits in GitKraken.

Watch this video or keep reading to learn more!

Download our Git GUI client for free, to easily squash commits in Git!

Download GitKraken Free

What does it mean to squash commits in Git?

Squashing is a way to rewrite your commit history; this action helps to clean up and simplify your commit history before sharing your work with team members.

Squashing Commits in Git

Squashing a commit in Git means that you are taking the changes from one commit and adding them to the Parent Commit.

Can you squash all commits in a branch?

Yes, you can squash commits multiple times on the same branch to go from many commits down to one commit.

Squashing multiple commits on same branch

How to squash commits in GitKraken

In order to have the ability to squash commits in GitKraken, the following criteria must be met:

  • You have more than one commit selected
  • The youngest commit is also the current HEAD
  • Your commits are genealogically consecutive (i.e. parent, child, parent, child)
  • Your commits are chronologically consecutive
  • The oldest commit in your selection needs to have a parent

If all of the above conditions are met, you will see an option to squash commits by right-clicking on the commit node after selecting the commits you wish to squash.

squashing commits in GitKraken
Pro Tip: to multi-select consecutive commits from the central graph, select one commit and hit and hold the Shift button before selecting the other commits.

Easy as that! You are now a master of squashing commits using the legendary GitKraken Git Client!

Watch this video and subscribe to our YouTube channel for more videos in the Learning Git with GitKraken series!

Stay on the cutting edge of software development by getting innovative tips, trends and stories delivered to your inbox every month!

Agile project management software
Plan, develop, review, and ship fast

Visit Axosoft.com

Legendary suite of developer tools
GitKraken Git GUI, Boards & Timelines

Visit GitKraken.com