Making a PR
Now that you know Git, it is time to send us your code
To create a Pull Request (PR) on GitHub, you need to follow a standard workflow that involves forking, cloning, branching, committing, pushing, and finally opening the PR. Here is the complete step-by-step guide with the exact buttons you need to click:
Step 1: Fork the Repository
- Navigate to the main GitHub page of the project you want to contribute to.
- In the top-right corner of the page, click the Fork button.
- Select your GitHub account as the owner.
- Click the green Create fork button. This creates a copy of the repository under your own GitHub account.
Step 2: Clone Your Fork
- On your new fork page, click the green <> Code button.
- Copy the HTTPS or SSH URL provided.
- Open your terminal or command prompt and run:
git clone <PASTE_URL_HERE>
- Move into the project directory:
cd <REPOSITORY_NAME>
Step 3: Create a New Branch
Never make changes directly to the main or master branch.
- In your terminal, create and switch to a new branch using a descriptive name:
git checkout -b my-contribution-branch
Step 4: Make Changes and Commit
- Open the project in your code editor and make your modifications.
- Save your files.
- In the terminal, stage your changes:
git add .
- Commit your changes with a clear message:
git commit -m “Fix: Describe the bug fix or feature here”
Step 5: Push Changes to GitHub
- Upload your new branch and commits to your GitHub fork:
git push origin my-contribution-branch
Step 6: Create the Pull Request
- Go back to your browser and visit your fork on GitHub.
- You will see a yellow banner at the top saying you recently pushed a branch.
- Click the green Compare & pull request button.
- Alternative: If you do not see the banner, click the Branches tab, find your branch, and click New pull request.
- On the PR creation page, ensure the base repository points to the original project and the head repository points to your fork and branch.
- Write a clear title and description explaining what changes you made and why.
- Click the green Create pull request button at the bottom of the form.
Any doubts or questions?
Join the Inled community