7. Pull Request
A Pull Request (PR), Merge Request on other Git hosts, is a request for a project's maintainers to review and merge your changes. It's the standard process for contributing to a project, or the heart of collaboration in open source.
The maintainers will review your PR, make comments, request changes, or approve and merge it.
Very rarely does a PR get merged without asking you for changes first. Don't take it the wrong way, the reviewer knows the project better than you and wants to keep the code quality high.
Open a Pull Request
- Go to your fork on GitHub
- You'll see a "Compare & pull request" message - click it
- Complete the PR form
- Click "Create pull request"
In summary, the full flow for creating a Pull Request would be:
- Create a fork of the project (if you haven't already; otherwise you should sync your fork first).
- Clone your fork locally (or use the one you already have).
- Create a specific branch for your change (NEVER work directly on
main). - Make your changes: small, focused commits with clear descriptions.
- Push to your branch in your fork.
- From GitHub, open a Pull Request from your branch to the main branch of the original repository.
- Wait for the review, respond to comments and make changes if necessary.
There's a very common convention for naming branches, as follows:
feature/description: New featurefix/description: Bug fixdocs/description: Documentation changesrefactor/description: Code refactoringtest/description: Add or improve tests
But it's not mandatory; each project can have its own conventions. What matters is that the name is descriptive. A clear, concise text that explains the "why" behind the changes. If you also include screenshots, videos and references to issues, all the better.
Then the review process begins, where you'll receive comments, suggestions and possibly change requests.
Be polite and grateful. Many maintainers are doing this in their free time. Their goal is to improve the project, not to criticize you personally.
Making changes to an existing PR
If the reviewer asks you for changes, keep working on the same branch you used for the PR. New commits will be added to the PR automatically.
Activity 1
Practice with a test repository:
- Create a repository called
pr-practiceon your GitHub. - Clone the repo and create a
CONTRIBUTORS.mdfile. - Add your name to the file.
- Commit and push.
- Create a new branch
feature/add-info. - Add more information (your GitHub profile, projects, etc.).
- Push the branch.
- Create a Pull Request from the branch to main.
- Review and merge your own PR.
Activity 2
Real contribution:
- Find a project with an issue marked "good first issue".
- Comment on the issue that you'd like to work on it.
- Fork the project.
- Create an appropriate branch.
- Implement the solution.
- Test your changes.
- Create a PR with a complete description.
- Respond to any feedback.
This work is under a Attribution-NonCommercial-NoDerivatives 4.0 International license.
Building SPAs with Django and HTML Over the Wire: Learn to build real-time single page applications with Python
The HTML over WebSockets approach simplifies single-page application (SPA) development and lets you bypass learning a JavaScript rendering framework such as React, Vue, or Angular, moving the logic to Python. This web application development book provides you with all the Django tools you need to simplify your developments with real-time results.
Buy the bookHelp me keep writing
Every coffee gives me a push toward the next article.
Sure, it's on me!
Comments
There are no comments yet.