Course contentsShow
← Git & GitHub
Lesson 71 of 964. Collaborative WorkflowsFree lesson

Submitting Contributions Through Pull Requests

Open a pull request from your fork to the original repository to formally propose your changes for review by the project maintainers.

In this lesson, you will learn how to formally propose your contributions to an open-source project by opening a pull request from your personal fork to the original upstream repository.

When you have been working on a feature in your own fork, you have essentially been working in your own "sandbox." To get your changes into the main project, you need to notify the original maintainers. A pull request (PR) acts as a bridge between your fork and the original repository, allowing maintainers to review your code, run tests, and discuss potential improvements before integrating it.

Opening the Pull Request

Once you have pushed your feature branch to your fork on GitHub, follow these steps:

  1. Navigate to the main page of the original repository (the "upstream" repo) on GitHub.
  2. You will likely see a yellow banner inviting you to "Compare & pull request." Click it.
  3. If the banner doesn't appear, click the Pull requests tab, then the green New pull request button.
  4. Click the "compare across forks" link to ensure you are pulling from your username/repository:branch into the original-owner/repository:main branch.
  5. Review the changes shown in the "Files changed" tab to ensure everything looks correct.
  6. Click Create pull request and add a clear title and description explaining what your changes do.

By clicking "Create pull request," you are initiating a formal proposal. The maintainers will receive a notification, allowing them to examine your logic and code style. Remember to check for a CONTRIBUTING.md file in the original repository before submitting, as many projects have specific guidelines on how they prefer these requests to be formatted.

Once the PR is open, your work is effectively "in the queue." You can continue to push new commits to your branch if the maintainers request changes, and the PR will automatically update to reflect those additions. This cycle of feedback and iteration is the heart of collaborative development.

Key Takeaway: Opening a pull request from your fork to the upstream repository is the standard way to submit your code for peer review and eventual integration into a project.