Git Installation and Configuration

GitGitBeginner
Practice Now

Introduction

Git is developed by Linus Torvalds, the creator of the Linux operating system. It is a free and open-source tool that is used by many developers and data scientists. It is a powerful tool that allows you to track changes to files and folders.

GitHub is a web-based hosting service for version control using Git. Now, it is developed by Microsoft.

In this lab, you will learn how to install git and configure it to work with your GitHub account.

Achievements

  • GitHub account registration
  • Git installation
  • Git configuration

Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL git(("`Git`")) -.-> git/SetupandConfigGroup(["`Setup and Config`"]) git/SetupandConfigGroup -.-> git/git("`Show Version`") git/SetupandConfigGroup -.-> git/config("`Set Configurations`") subgraph Lab Skills git/git -.-> lab-24{{"`Git Installation and Configuration`"}} git/config -.-> lab-24{{"`Git Installation and Configuration`"}} end

GitHub Account Registration

It's free and easy to create a GitHub account. You can use your GitHub account to store your code and collaborate with other developers. You can also use it to host your website.

Create a GitHub Account

To create a GitHub account, go to the GitHub website and click Sign up. Then, fill in the required information and click Create an account.

Verify Your Email Address

After creating your GitHub account, you will receive an email from GitHub. Click the link in the email to verify your email address.

Now, you have created a GitHub account. In the next step, you will learn how to install git on your computer.

Git Installation

Git is available for Windows, Mac, and Linux. In this step, you can install git on your computer or use the cloud-based git environment.

Our cloud-based terminal environment already has git installed. :)

Try to input git help:

git-installation-and-config

Install Git on Linux

If you are using Linux, you can install git using the package manager of your distribution. For example, if you are using Ubuntu, you can install git using the following command:

sudo apt install git

Install Git on Mac

If you are using Mac, you can install git using the Homebrew package manager. To install Homebrew, run the following command in your terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

After installing Homebrew, you can install git using the following command:

brew install git

Install Git on Windows

If you are using Windows, you can download the latest version of git from the official website. After downloading the installer, run it and follow the instructions.

Git Configuration

If you want to use git with your GitHub account, you need to configure git to work with your GitHub account. Let's do it.

Configure Git

To configure git, you need to provide your GitHub username and email address. To do this, run the following commands in your terminal:

git config --global user.name "your_username"
git config --global user.email "your_email"

You can use any username and email address. However, it is recommended to use the same username and email address that you used to create your GitHub account.

Summary

Congratulations! You have successfully installed Git and configured it to work with your GitHub account.

In the next module, you will learn how to create a repository and use it to store your code.

:)

Other Git Tutorials you may like