{"meta":{"title":"Squashing commits in GitHub Desktop","intro":"You can use GitHub Desktop to squash commits in your branch's history.","product":"GitHub Desktop","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/desktop","title":"GitHub Desktop"},{"href":"/en/enterprise-cloud@latest/desktop/managing-commits","title":"Managing commits"},{"href":"/en/enterprise-cloud@latest/desktop/managing-commits/squashing-commits-in-github-desktop","title":"Squashing commits"}],"documentType":"article"},"body":"# Squashing commits in GitHub Desktop\n\nYou can use GitHub Desktop to squash commits in your branch's history.\n\n## About squashing a commit\n\nSquashing allows you to combine multiple commits in your branch's history into a single commit. This can help keep your repository's history more readable and understandable.\n\n## Squashing a commit\n\n1. In GitHub Desktop, click **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-git-branch\" aria-label=\"git-branch\" role=\"img\"><path d=\"M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z\"></path></svg> Current Branch**.\n\n   ![Screenshot of the repository bar. A button, labeled \"Current Branch\" with a downward arrow indicating a dropdown menu, is outlined in orange.](/assets/images/help/desktop/current-branch-menu.png)\n\n2. In the list of branches, select the branch that has the commits that you want to squash.\n\n3. In the left sidebar, click **History**.\n\n   ![Screenshot of the \"History\" tab in the sidebar. Above a list of commits, the tab button, labeled \"History\", is highlighted with an orange outline.](/assets/images/help/desktop/history-tab-in-commit-sidebar.png)\n\n4. Select the commits to squash and drop them on the commit you want to combine them with.\n\n   <div class=\"ghd-tool mac\">\n\n   You can select one commit or select multiple commits using <kbd>Command</kbd> or <kbd>Shift</kbd>.\n\n   </div>\n\n   <div class=\"ghd-tool windows\">\n\n   You can select one commit or select multiple commits using <kbd>Ctrl</kbd> or <kbd>Shift</kbd>.\n\n   </div>\n\n   ![Screenshot of a list of commits in the \"History\" tab. The cursor hovers over a commit, highlighted in blue. A hover-over box shows \"Squash 2 commits\".](/assets/images/help/desktop/squash-drag-and-drop.png)\n\n5. Modify the commit message of your new commit. The commit messages of the selected commits you want to squash are pre-filled into the **Summary** and **Description** fields.\n\n6. Click **Squash Commits**.\n\n## Error messages when squashing commits\n\nWhen you squash commits, you may see one of the following notifications or error messages.\n\n* A notification states that the requested change to the branch will require a force push to update the remote branch. Force pushing alters the commit history of the branch and will affect other collaborators who are working in that branch. Select **Begin Squash** to start the squash, and then click **Force push origin** to push your changes.\n* An error states that the squash failed because there is a merge commit among the squashed commits.\n* A notification is shown indicating that there are uncommitted changes present on your current branch. Select **Stash Changes and Continue** to store the changes and proceed, or select **Close** to dismiss the message and commit the changes. When there are no longer any uncommitted changes you can squash your commits.\n\n## Further reading\n\n* [Options for managing commits in GitHub Desktop](/en/desktop/managing-commits/options-for-managing-commits-in-github-desktop)"}