Table of Contents

GitHub isn’t just about storing code; it’s about collaboration. Whether you’re working with a team or submitting assignments, GitHub provides tools to manage changes and keep projects organized.

One of the most important of these tools is the pull request (PR). A pull request is a formal way to propose changes, invite feedback, and ensure everything is reviewed before merging into the main branch. This process maintains code quality, supports collaboration, and creates a transparent record of contributions.

In GitHub Classroom assignments, pull requests let your instructor review your work before it’s merged into the shared repository.

🛠 Creating a Pull Request

📝 Version Control | 🕑5 minutes | Required Files : none

Step 1: Open GitHub Desktop

  1. Click Preview Pull Request.
  2. Ensure you are on the branch you created for the exercise.
  3. Verify that all changes have been committed and pushed to GitHub.
Preview a Pull Request in GitHub
Preview a Pull Request in GitHub

Step 2: Review Pull Request Details

  1. A preview of the pull request will display, highlighting any conflicts with the main branch.
    • If no conflicts exist, proceed to the next step.
    • If conflicts exist, resolve them before continuing.
  2. Click Generate Pull Request.
Generate a pull request
Generate a pull request

Step 3: Open and Edit the Pull Request

  1. The Open a Pull Request page will open in your browser.
  2. The title will default to your latest commit message—rename it to reflect the exercise name.
  3. Provide a brief description:
    • Summarize what changes were made.
    • Mention any questions or issues you encountered.
Open a pull request
Open a pull request

Step 4: Set Assignee and Label

  1. On the right side of the page:
    • Set Assignee to yourself.
    • Set the Label to Exercise.
Assign and label pull request
Assign and label pull request

Step 5: Create the Pull Request

  1. Click Create Pull Request.
  2. The pull request will now be visible in the repository.

DO NOT MERGE PULL REQUESTS

Do not merge pull requests unless you are working on a solo project. In GitHub Classroom assignments, your instructor will review and handle merging. Similarly, when collaborating with a team, pull requests should always be reviewed by at least one other person before merging to ensure code quality and avoid conflicts.

Do Not Merge pull requests
Do Not Merge pull requests

Step 6: Review and Merge

On a team project, one or more individuals are usually designated as Git Managers, often the team lead, senior developer, or art director. They are notified of pull requests and are responsible for reviewing and merging changes. In the case of GitHub Classroom, your instructor receives the pull request notifications and will handle the review and merging process.

  1. Git Manager will receive a notification of the pull request.
  2. Once graded, your instructor will merge and close the pull request.
Merging and closing pull requests
Merging and closing pull requests

Pull requests are a central part of collaborative workflows on GitHub, allowing changes to be proposed, reviewed, and merged in a controlled and transparent way. Whether you’re working in a team or submitting a GitHub Classroom assignment, following the proper pull request process ensures code quality, clear project history, and effective collaboration. Always remember: changes should be reviewed before merging, with designated Git managers or instructors handling the final approval.

Tagged in:

,