A Guide to GitHub Pull Requests

A Guide to GitHub Pull Requests

GitHub-1

When I decided to start using GitHub in my freshman year of college, I was terrified for several reasons, one of which was the plethora of tutorials, none of which helped me as I hoped. So, I will introduce you to this new GitHub series. In this article, I will explain the nuances of GitHub that often confuse us. I hope you find this useful.

Now, let's take a brief introduction of GitHub:

What is GitHub in plain English?

GitHub is a version control system, which allows you to save your code on the cloud and track its changes. You can therefore manage the version of your software, website, or any document.

What exactly is a pull request?

In layman's terms, a pull request is a request you make to the repository's owner with any modifications you've made to an existing file of code or readme. If you wish to combine your code with the existing one (the main project repository), you send a pull request, which is also known as a merge request.

Now let's get started.

You can follow along with my instructions using this repository:

Step 1: Go to the Repository

Use the URL provided above to access the specified page.

Step 2: Fork the Repository

Click the circled Fork button to create a copy of the repository on your GitHub account.

After clicking it, you will see the following:

Before clicking on the create fork button, you can also modify the repository's name and description to your requirements.

Here, the initial box in the right-hand corner displays the user name and repository name.

The middle box indicates that the focked branch is identical to the copied branch, but once the modification is made, a new statement appears indicating how far ahead of the original repository you are.

Step 3: Making changes in the repository

Click the pencil in the upper left corner of the README.md box, as shown in the figure above. It will provide you with the option to make changes.

Now you may commit to whatever you choose, but we will do something straightforward. If you want to do something challenging, select commands from this list:

Basic writing and formatting syntax

Write your name and link your LinkedIn. Let's do it.

>[User-1233](https://www.linkedin.com/in/tripur-joshi/)

Now scroll down.

Directly click on the button Commit Changes

Here, you can see the changes. Then click on GitHub-Practice.

The repository is two commits ahead, as can be seen. That indicates the updates have been done. Let us now create a pull request.

Simply click on Contribute button where you will see the Open pull request

Click the Create pull request button to send the pull request to the original repository's maintainer.

Now your pull request is sent.

And the repository's creator will get a pull request to merge your code into the main branch. From the perspective of the repository's creator, the image depicted below depicts this.

After your pull request is accepted you can view the outcomes in a few days depends when the creator will accepts your request.

GitHub is fairly straightforward when you know what to do and are not confused. This blog shows you git pull request in README.md file however updating code/coding files is quite different which I will cover in the upcoming parts. Hope this was useful for you and helped get a basic hold of GitHub. Alright!