Welcome back to our beginner-friendly Git series! ๐
In EP03, we cloned a project, created a feature branch, wrote a Python script, and pushed our changes to GitHub.
Now itโs time to learn how to open a Pull Request (PR) and merge it into the main codebase โ using GitHubโs interface.
A Pull Request is how you propose changes, review code, and collaborate before merging it into shared branches like
developormain.
What Is a Pull Request?
A Pull Request (PR) is like saying:
โHey, Iโve made some changes โ can we review and add them to the main project?โ
Itโs a common workflow used in open source and team projects to:
- Collaborate safely
- Review changes before merging
- Trigger CI/CD pipelines or tests (in advanced setups)
Step-by-Step: Creating & Merging a Pull Request
1. Push a Feature Branch to GitHub
If youโve followed along from EP03, you should already have done this:
git push -u origin feature/add-greeting-script
Your code is now in a branch on GitHub, ready to review.
2. Go to Your GitHub Repository
Visit your repoโs page on GitHub.
Youโll usually see a banner like this:
This banner appears above the branch and code section, making it easy to start the pull request process.
Compare & pull request
"feature/add-greeting-script" had recent pushes less than a minute ago.
If You Donโt See the Banner
In that case, you can manually go to the Pull Requests tab
And click โNew pull requestโ
Whether you come from banner or tab you will lead to this page
Select Branches to Create a Pull Request
On the GitHub "Compare changes" page, you'll need to choose the branches involved in your pull request:
- Set the base branch (the target) โ in our case:
develop - Set the compare branch (the source) โ in our case:
feature/add-greeting-scriptThis is the branch where your changes were made. - You can use the dropdown menus to switch between available branches.
Our Example
In this tutorial, weโre creating a pull request from feature/add-greeting-script to develop.
Reviewing the Changes
GitHub will compare both branches and display the differences:
- Added, modified, or deleted files
- Line-by-line code changes (highlighted in green(add) and red(remove))
If everything looks correct and you're confident in the changes, click the green "Create pull request" button.
This will open a form where you can add a title and description for your pull request before submitting it.
3. Fill Out the Pull Request Form
Now youโre on the PR creation page.
Hereโs what to do:
- Title: GitHub auto-fills it from your last commit (which is why Conventional Commits help!) Example:
feat(main): add greeting script in main.py
- Description: Write what this PR does, e.g.
This pull request adds a basic Python script (main.py) that greets the user.
This is part of the Git learning series EP04.
Add Reviewers and Assignees
- Reviewers: People expected to review the code. They can approve or request changes.
- Assignees (optional): Person responsible for tracking or managing the PR (can be the same as the author).
Even if no assignee is selected, the PR can still be merged โ as long as permissions and review rules allow it.
After everything click green button "Merge Pull Request"
It will ask you to confirm, you can simply select "Confirm merge" green button
And Youโre Done!
You can also delete this branch because weโve already merged it.
After delete this is the result
6. Pull the Latest Code Locally
To update your local repo with the merged changes:
git checkout develop
Apply git pull
git pull
Your develop branch is now fully up to date with the remote version.
Summary Diagram: PR Workflow
[ Coder (Author) ]
โ
โผ
[ Push branch to GitHub ]
โ
โผ
[ Open Pull Request ]
โ
โโโ Set Title (auto-filled from commit)
โโโ Write Description
โโโ Add Reviewer(s)
โโโ (Optionally) Assign responsible person
โ
โผ
[ Reviewer(s) Review the Code ]
โ
โโโโโโดโโโโโ
โ โ
[ Approve ] [ Request Changes ]
โ
โผ
[ Merge Pull Request ]

















Top comments (0)