Install and Configure git in Linux and Ubuntu EC2 Instance

Installation of GIT on RHEL

Install Server Updates

yum update -y

Install git package

yum install git -y

Verify git Package

which git

Check Version of git Package

git — version

Set Username Configuration

git config — global user.name “Ram”

Set Email Configuration

git config — global user.email “username@gmail.com”

Verify Username and Email Configurations

git config — list

Set the Date

date +%T -s”21:43:00"

Verify Date

date

Installation of GIT on UBUNTU 18.04

Step 1 — Update Default Packages

Logged into your Ubuntu 18.04 server as a sudo non-root user, first update your default packages.

Step 2 — Install Git

Step 3 — Confirm Successful Installation

You can confirm that you have installed Git correctly by running this command and receiving output similar to the following:

git --version

Step 4 — Set Up Git

Now that you have Git installed and to prevent warnings, you should configure it with your information.

git config --global user.name "Your Name"

git config --global user.email "youremail@domain.com"

If you need to edit this file, you can use a text editor such as nano:

vi ~/.gitconfig

~/.gitconfig contents

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store