Hey there How is it going , Lets learn how to make a pull a request practically...
PermalinkPULL REQUEST
A Pull Request, or PR, is a way to contribute to a repository in GitHub.
A Pull Request allows us to contribute code to our own repo, our teams repo, or an open source repo.
So lets get started . . .
PermalinkSTEP 1
we need to fork the repository for which we wish to made a change
Go to this repository
click on fork it creates a copy of that into your account
click on code and copy the repo link as shown below(click on slate board)
PermalinkSTEP 2
Now we need to setup our local environment so that we can make changes to that repo locally
open terminal or cmd
follow the commands
- Move to the directory where you want to work
$ cd Desktop
- Now we need to use the copied link.
$ git clone link_you_copied
- Move to the repo folderso now all the files of the project should appear on your device
$ cd PR-DEMO
- Now we need to add remote remo so that we can push the changes
$ git remote add origin link_you_copied
- we need to make a seperate branch so that it creates a seperate development line
from master branch
$ git checkout -b first-pr
- Move to the directory where you want to work
PermalinkSTEP 3
open html file in your browser. It should appear the conributors and the technologies they love for our project so far
Now its time to contribute yourself to the project
open the project files and add your name and technologies you love to the code something like this
<tr> <td>Your name</td> <td>Tech you love</td> </tr>
You have made changes to the code
PermalinkSTEP 4
Now we need to push the local changes our remote repo
Add modified files to the staging area (index.html in our case)
$ git add index.html $ git commit -m "added me to the contributors list" $ git push origin first-pr
PermalinkSTEP 5
Open the gituhub and PR_DEMO (which we cloned) repository
We should see an option like compare and pull request
Hit that
Now it shows for a comment box and a create pull request option under it
add some comments like "added me to the contributors list" and hit create pull request
Hurrah we have made our first PR you can check your what are all PR s you have made and their status at pull request section
Once our PR got approved it click on merge pull request button that appears at tha bottom.
##SUMMARY
Forked the repo
Cloned it to our local machine
Created a branch
Made some changes
Push the changes to the remote repo
Create a pull request
✨ Done !!!
Hope you understand it . Feel free to ask in the comments if you get stuck at any point. Thank you . . .