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!
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 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.
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.
Easy as that! You are now a master of squashing commits using the legendary GitKraken Git Client!
Stay on the cutting edge of software development by getting innovative tips, trends and stories delivered to your inbox every month!