Skip to Content

GitHub Foundations: What Is Not Valid Reason for Creating Pull Request on GitHub?

Learn why creating a pull request to alert another contributor about a merge conflict is not an appropriate use of pull requests on GitHub. Understand the proper reasons for opening PRs.

Table of Contents

Question

What is not a good reason to create a pull request?

A. You would like to receive feedback on prospective changes before merging your feature branch into main.
B. You want to merge your bug fix branch into main, but don’t have permission.
C. Your branch can’t be merged into main due to upstream changes made since you created it. Creating a pull request lets the other contributor know they need to pull their changes out so you can put yours in.

Answer

C. Your branch can’t be merged into main due to upstream changes made since you created it. Creating a pull request lets the other contributor know they need to pull their changes out so you can put yours in.

Explanation

This isn’t how pull requests work. Also, the etiquette is for you to be sure your branch can be cleanly merged into the base before creating a pull request.

Creating a pull request to let another contributor know that their changes are blocking your ability to merge into the main branch is not a good reason to open a pull request. Pull requests should be used for the following purposes:

  • To propose changes and request feedback before merging a feature branch into the main branch. This allows for code review and discussion.
  • To request permission to merge changes, such as a bug fix, into a branch that you don’t have direct push access to. The pull request serves as a way to request and grant merge permissions.

However, pull requests are not the appropriate mechanism for alerting others about merge conflicts. If your branch cannot be merged into main due to conflicting changes made by another contributor after you created your branch, the correct course of action is:

  1. Pull the latest changes from the main branch into your local branch
  2. Resolve any merge conflicts locally by manually editing the conflicting files
  3. Commit the conflict resolutions
  4. Push your updated branch
  5. Create a pull request (if necessary) to merge your changes into main

At no point should you create a pull request simply to notify someone else that their changes are preventing your merge. It’s your responsibility to resolve conflicts locally before submitting a PR. Communication about resolving conflicts should happen through other channels like comments, issues, or direct messages, not through pull requests themselves.

GitHub Foundations certification exam assessment practice question and answer (Q&A) dump including multiple choice questions (MCQ) and objective type questions, with detail explanation and reference available free, helpful to pass the GitHub Foundations exam and earn GitHub Foundations certification.