Lets Learn How to Make a Pull Request.

Lets Learn How to Make a Pull Request.

Hey there How is it going , Lets learn how to make a pull a request practically...

PULL 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 . . .

STEP 1

  • we need to fork the repository for which we wish to made a change

  • Go to this repository

fork.jpg

  • 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)

copy.jpg

STEP 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

    1. Move to the directory where you want to work
         $ cd Desktop
      
    2. Now we need to use the copied link.
        $ git clone link_you_copied
      
    3. Move to the repo folder
        $ cd  PR-DEMO   
      
      so now all the files of the project should appear on your device
    4. Now we need to add remote remo so that we can push the changes
        $ git remote add origin link_you_copied
      
    5. we need to make a seperate branch so that it creates a seperate development line from master branch
        $ git checkout -b first-pr
      

STEP 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

STEP 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
    

STEP 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 . . .