/

How to Create Your First Pull Request on GitHub

How to Create Your First Pull Request on GitHub

Creating a pull request (PR) to make edits on a project hosted on GitHub doesn’t always have to involve contributing code. In fact, even non-developers can participate by simply editing a file, such as a project’s README to fix a typo. By learning how to create pull requests, you can not only collaborate with others on projects but also gain the confidence to contribute code in the future.

Assuming you already have a free GitHub account, let me walk you through the process. Here’s an example:

  1. Identify the file you want to edit on GitHub. In this case, I found a possible typo in an article on the web.dev website.

  2. Open the index.md file directly on GitHub and click the pencil icon in the file toolbar. This allows you to edit the file.

  3. A new view will open displaying the editor. Here, you can make your desired changes.

    • Information displayed:

      You’re editing a file in a project you don’t have write access to. Submitting a change to this file will write it to a new branch in your fork flaviocopes/web.dev, so you can send a pull request.

  4. After making the necessary changes, scroll down to the form at the bottom and provide a clear explanation of the changes you made.

  5. Click the “Propose File Change” button, and a compare view will appear. Review the changes you made to ensure everything looks good.

  6. Finally, click the “Create Pull Request” button. This will create a pull request in your forked version of the project, which GitHub automatically created when you clicked the pencil icon.

  7. On the pull request view, you will see the details of the pull request you’re about to submit. Additionally, you can write a detailed description of the changes you made.

  8. If necessary, you can add a summary to the pull request to better manage changes.

  9. At this point, you may need to sign a Contributor License Agreement (CLA) to complete the pull request. Follow the provided instructions if this step applies to you.

  10. Once you’ve completed the necessary steps, click “Create pull request” to submit your pull request.

Now, it’s up to the project maintainers to review and potentially accept your changes. You’ll receive an email notification when your pull request is merged or if there are any comments or modifications requested.

Remember, if your pull request is not accepted, don’t get discouraged. Project maintainers are knowledgeable about their projects and might have different views on what is best. It’s also a good idea to check with the project maintainers before working on a substantial pull request to ensure it aligns with their needs.

[tags: GitHub, pull request, editing files, collaboration]