Step by step guide to make PR on GitHub

#git, #guide

This is an instructional guide for the “fork and pull request” workflow, which is a common practice to make PR (pull request) to contribute to a project on GitHub:

  1. Make a fork from the source project: Go to the project’s repository main page and create a fork of it. This makes a copy of the project’s repository and adds it to your own repositories list.

    If you’ve already created the fork, make sure the project is up to date with the source repository. If it wasn’t up to date, click the “Sync” button to pull from the upstream repository.

  2. Get the project on your local: If you haven’t get the project on your system yet, clone the project. This downloads the project files in the main branch on your machine.

     $ git clone <your_forked_repository_url> 
    

    If you’ve already cloned the project’s repo, make your local main branch up to date by pulling from your remote main branch.

     $ # In new git versions `master` branch replaced by `main` branch
     $ git checkout master # optional: use this command if you're not on `master`
     $ git pull