How to create a pull request
If you are a strong developer chances are you have come across the word " Pull Request ".If this is the first time you have come across it don't worry you are not alone. Most developers usually learn about this kind of terminologies when they switch from solo development to team development or opensource contribution like how I came across it.
So you want to make a pull request yes? Let's skip the stories and go right to it.
When you want to work on a GitHub project, the first step is to fork a repo.
Use this demo repo to try it out.
Once there, click on the Fork button in the top-right corner. This creates a new copy of my demo repo under your GitHub user account with a URL like:
https://github.com/<Your_github_userName>/demo-repo
The copy includes all the code, branches, and commits from the original repo.
Next, clone the repo by opening the terminal on your computer and running the command:
git clone https://github.com/<Your_github_userName>/demo-repo
Once the repo is cloned, you need to do two things:
- Create a new branch by issuing the command:
git checkout -b your_new_branch
2.Create a new remote for the upstream repo with the command:
git remote add upstream https://github.com/dbrax/demo-repo
In this case, “upstream repo” refers to the original repo you created your fork from.
Now you can make changes to the code. The following code creates a new branch, makes an arbitrary change, and pushes it to your_new_branch
:
Once you push the changes to your repo, the Compare & pull request button will appear in GitHub.
When you click on compare and pull request
Open a pull request by clicking the Create pull request button. This allows the repo’s maintainers to review your contribution. From here, they can merge it if it is good, or they may ask you to make some changes.
Before you go… Thanks for reading the article! If you enjoyed it, please don’t forget to show your appreciation by clicking 👏 below!
Any questions or comments hit me up on
Mail: epmnzava@gmail.com
Twitter: https://twitter.com/epmnzava
Github: https://github.com/dbrax