Adetutu Oluwasanmi
Adetutu Oluwasanmi

Follow

Adetutu Oluwasanmi

Follow
How to create a push and pull request on GitHub

How to create a push and pull request on GitHub

Adetutu Oluwasanmi's photo
Adetutu Oluwasanmi
·Nov 29, 2022·

2 min read

Table of contents

  • What is Git/GitHub?
  • What is a push and pull request?
  • How to create a push request
  • How to create a pull request

What is Git/GitHub?

Git is a version control system that assists you in managing and tracking your code. GitHub is a cloud-based platform for collaboration and hosting git repositories.

What is a push and pull request?

A push request allows you to send recent commits from your local repository to GitHub, whereas a pull request notifies the code maintainer of a newly added branch on the Git repository.

How to create a push request

STEP 1: Open your GitHub account, navigate to an existing repository, click on "code", and copy the repository link.

copy.PNG

STEP 2: Create a folder on your desktop/computer and open the folder with Git bash

step 2.PNG

STEP 3: Clone the repository on your GitHub by using the command and copy the repository link

git clone {repo link}

clone.png

STEP 4: To open your code editor, enter the command "code ."

code.png

STEP 5: Create a new branch by using the command;

git checkout -b “branch-name”

branch.png

STEP 6: To add all changes and edits made in this new branch, using the command;

git add .

add.png

STEP 7: Create a commit and save all changes made in this new branch

git commit -m “branch-name”

branch.png

STEP 8: Upload your local repository content to a remote repository using the command below

git push –set-upstream origin chats-section

push.png

How to create a pull request

STEP 1: After successfully pushing your commit to a specific branch, navigate to the project repository on GitHub and create a pull request.

Note: It is recommended to include a comment explaining what your newly created branch is about, as well as a screenshot of your code's UI.

pull request.PNG

STEP 2: Merge your pull request with the repo's main branch, but this should be reviewed and executed by the creator/owner of the repository

merge pull request.PNG

STEP 3: When the commits are merged, they are added to the main branch.

merged.PNG

Cover image credit: Photo by Luis Gomes on Pexels.com

 
Share this