Home > Development Tools > git > How to raise PR on github

How to raise PR on github

王林
Release: 2023-05-17 10:03:36
Original
1529 people have browsed it

GitHub is one of the world's largest open source project hosting platforms. It provides developers with an excellent tool and platform to collaborate on development and share their results. On GitHub, developers can work together in the open source community, share and exchange ideas, and share code.

Pull Request (PR) is one of the very important features on GitHub, which allows developers to modify or add code and submit it to others for review. In this article, we will explain how to use GitHub to submit a pull request.

  1. Create a branch

Before you start any programming work, it is a good idea to copy the code base to your own GitHub account. To do this, a new branch needs to be created. A branch is a version that is separated from the main branch (usually "master" or "master"). Work on a new branch without affecting the main codebase, and you can merge it when you're done.

To create a new branch, you can find the "Code" button on the warehouse home page, select the branch you want to detach from in the drop-down menu, and click the "Branch" button. On the Branches page, enter a name for the new branch you forked and click Create Branch.

  1. Do some development work

Now that you have your own branch, you can do some development work on it. After you've made your changes, you'll need to distribute the code to others for review.

  1. Submit your Pull Request (PR)

After the code for the above branch has been tested and works correctly, it can be pushed to GitHub. This can be done by opening the web page for this branch and clicking the "Pull Request" button.

On this page, you can enter some information about the changes you just made and who you want your PR to be reviewed by. If you’re still not sure how to describe a PR, check out some excellent PRs for reference.

Please try to avoid unnecessary filling in, for example: you do not need to make any changes to the "Target Branch", but should keep the default settings.

  1. PR Review

The person assigned as a PR reviewer will now review it. If your PR doesn't work, they will raise an issue and discuss it on this thread.

If the problem is minor, you just need to make changes to your code and submit again. If the problem is large, you may need to rethink your implementation and rewrite the code.

If your PR does not pass the review, you can submit the code again until it meets the qualified standards. Once your PR passes review, it will be merged into the main code base by the reviewers and published as a new updated version.

Summary

GitHub plays an extremely important role in collaborative programming, and it is very important to understand how to use PR to submit code. Since PR is the most difficult and error-prone part of the entire process, it takes a long time to practice and hone. But if you follow the steps above, you can become a professional team player!

The above is the detailed content of How to raise PR on github. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template