Git & GitHub — Open a Pull Request [As fast as possible]

[img] Git Commits
Photo by Yancy Min on Unsplash

Git — Understanding The Basics

So what is git? A confusing one, isn’t it? Off course yes, until we learn the basics.

Git is like our own brain when we try to learn a new dish. Let’s assume Octocat loves cooking 👨‍🍳. One day he wanted to make a new dish, yummy dish 😋. He collected a lot of spices. First, he cooked a dish with a combination of spices. The taste was okay 👌, so he remembered the combination. He tried another combination. But ….. 😕 not tasty. So he just simply remembered the previous combinations of good taste and started modifying that. One day his friends came and learn the combination of the spices of the new dish and started modifying that.

In the technical term, git is a version control system with two main purposes — code backup and versioning. Remembering the combination of spices for the dish is code backup and try the previous combinations is code versioning.

1. Installing Git

a. Installing Git on Windows

For windows, the official release is available for download on Git website

b. Installing Git on Linux

$ sudo apt update
$ sudo apt install git

c. Installing Git on macOS

On macOS just type git --version to check git version. If not installed, it will prompt to install git. Besides, the download link the binary is —

2. Setting up Git

Let’s configure git -

$ git config --global "<YOUR_NAME>"
$ git config --global "<YOUR_EMAIL>"

Type the following command to verify the configuratio -

$ git config --list

This will output as follows -<YOUR_NAME><USER_EMAIL>

GitHub — The Hub for Our Codes


GitHub is a code hosting platform for version control and collaboration.

Steps to make a Pull Request

1. Select a repo on GitHub

There are a lot of repos on GitHub. If you are searching for beginner level projects, you can go for ‘good-first-issue’ or projects on your interest.

2. Fork the repo on your account


3. Clone the repo on your local machine


Copy the https link and write the command — It’s like<YOUR_USERNAME>/<REPO_NAME>.git

$ git clone <COPIED_LINK>

4. Open the the repository in a code editor (eg VS Code, Atom)

$ git cd <REPO_NAME>
$ code .

Here code is for VS Code.

5. Change, Add, Commit and Push

Make some valid changes on the repository. After changing the you need to add those changes to git —

$ git add .

After that make a commit for the changes -

$ git commit -m "<YOUR_MESSAGE>"

Push the changes to GitHub

$ git push

6. Open a Pull Request

Pull request is the way we propose our changes to accept in the parent repository.

Initiate PR
Confirm the changes
Write description and open the PR

🎉🎉🎉 Congratulations. You just learn the basics of git and pull request

Student | Developer | Contributor