🔥 How to merge a pull request

iamandrewluca

Andrei L

Posted on March 3, 2020

🔥 How to merge a pull request

There are some rules that are best to follow when merging a pull request.

When merging a pull request, GitHub offers 3 options:

  • Create a merge commit
  • Squash and merge
  • Rebase and merge

We should use each of them depending of the situation:

  • If PR has only one commit and commit explains well what was done use Rebase and merge
  • If PR has only one commit but commit does not explain exactly what was done use Squash and merge and add commit name that will explain more exactly what was done
  • If PR has more commits but they are intermediary (ex: fix style, add object, remove test ) also use Squash and merge and add a commit name that will group all commits in one
  • If PR has more commits but every commit has an explicit title what has been done, each commit is a single unit, then use Create a merge commit so each commit will be visible in default branch

If you want to read more about how to write correct commit messages, follow the link https://conventionalcommits.org

Cover Photo by pine watt on Unsplash

💖 💪 🙅 🚩
iamandrewluca
Andrei L

Posted on March 3, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related