Merge Your Pull Request


If all of your checks are passing and you do not have any requested changes from other students, you can go ahead and merge your pull request:

gif of directions

  1. Open your Pull Request to be merged.
  2. Scroll to the bottom of the Pull Request and click the Merge pull request button.
  3. You can accept the default merge commit message.
  4. Click Confirm merge.
  5. Click Delete branch to delete the branch, as it no longer contains unique work.
Tell me why

Merge Explained

When you merge your branch, you are taking the content and history from the branch you created and adding it to the content and history of the master branch.

Merge visual

Tips for Merging with Teams

Many project teams have established rules about who should (or shouldn’t) merge a pull request:

  • Some say it should be the person who created the pull request since they will be the ones to deal with any issues resulting from the merge.
  • Others say it should be a single person within the project team to ensure consistency.
  • Still others say it can be anyone other than the person who created the pull request.

This is a discussion you should have with the other members of your team.

Tools for Safer Merges

GitHub also provides tools that can help you ensure that the code you are merging is safe! For example, this repository uses continuous integration to validate the syntax in your file and it uses protected branches to prevent you from merging the branch if your file contains errors. We will spend more time on these features in another class!

Using Code Review

GitHub also includes a code review feature that allows others to indicate they have looked over the code and either Approve it or Request Changes.

Merging Your Pull Request

When all of the comments have been addressed and all of the builds are passing, you are ready to merge your pull request. This video will show you how easy it is:

Stuck? Open an issue in the repository for this class and mention @githubteacher for help from one of the GitHub trainers!