Now Up To  80% OFF  GitKraken Pro
Upgrade to Save
Search
Close this search box.

Git Squash

Git Squash Commits

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

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

Squashing is easier when you’re able to clearly see all of your commits listed listed in order in GitKraken’s central graph. Try an easier way to squash commits ⬇️

Can you Git squash all commits in a branch?

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

Without the visual context offered by GitKraken, squashing all of the commits in a branch can be complex in the CLI. GitKraken gives you more control when performing advanced Git actions.

How to Git Squash Commits in GitKraken

In order to have the ability to Git 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 Git squash commits by right-clicking on the commit node after selecting the commits you wish to squash.

Squashing Commits in GitKraken Desktop

Git Squash 2 Commits

In GitKraken, you can multi-select consecutive commits from the central graph to Git squash 2 commits, or more, at the same time. Select one commit from the graph 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 GUI!

Additional Resources

Table of Contents

Make Git Easier, Safer &
More Powerful

with GitKraken

Visual Studio Code is required to install GitLens.

Don’t have Visual Studio Code? Get it now.

Team Collaboration Services

Secure cloud-backed services that span across all products in the DevEx platform to keep your workflows connected across projects, repos, and team members
Launchpad – All your PRs, issues, & tasks in one spot to kick off a focused, unblocked day. Code Suggest – Real code suggestions anywhere in your project, as simple as in Google Docs. Cloud Patches – Speed up PR reviews by enabling early collaboration on work-in-progress. Workspaces – Group & sync repos to simplify multi-repo actions, & get new devs coding faster. DORA Insights – Data-driven code insights to track & improve development velocity. Security & Admin – Easily set up SSO, manage access, & streamline IdP integrations.
winget install gitkraken.cli