This site runs best with JavaScript enabled.Automatically Squash Commits When Merging PRs

Automatically Squash Commits When Merging PRs

March 22, 2020


In the past, I didn't think much about my commit messages or my commit history. Over time, that has changed.

Now that I commit more often, I find it helpful to squash commits when I merge PRs. This keeps the commit history clean. I like it!

Here's how you can do it too:

  1. Go to your repo's homepage on GitHub
  2. Click on the "Settings" tab
  3. Scroll to the "Merge button" section
  4. Check the box for "Allow squash merging"

Now when you go to merge a pull request, you'll see an option called "Squash and merge".

Hooray! That's it :)

Discuss on TwitterEdit post on GitHub

Share article

Join the Newsletter

I send an email or two per month to share things I'm excited about. I'd be delighted if you signed up.



Help others learn to code