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:
- Go to your repo's homepage on GitHub
- Click on the "Settings" tab
- Scroll to the "Merge button" section
- 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 :)