How To Install Git In AWS EC2 Instance

How to install Git in AWS EC2

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In this series, we will explore one of the most popular distributed version controlling tool Git. In this demo, we will install Git in AWS EC2 instance and setup our 1st local Git repository.

What is Git?

Git is a fast, scalable, revision control system with an unusually rich command set that provides both high-level operations and full access to internals.

Git installation on AWS EC2 instance:

#Create an EC2 instance with Amazon Linux 2 with internet access
#Connect to your instance using putty

#Perform a quick update on your instance:
sudo yum update -y

#Install git in your EC2 instance
sudo yum install git -y

#Check git version
git version

Setup Git local repository in EC2 instance:

#create a directory named employee
mkdir mygit

#get inside mygit directory
cd mygit/

#initialize git local repository
git init

#observe .git file is created in your local git repository which
#contains data and metadata of your local git repository
ls -a
ls -a .git/

#check git status
git status

#getting help from the command line
git help

#list all git commands and sub-commands
git help -a

#getting help for a particular git command
git help <command> # for example, git help init will provide details of git init command

Hope you have enjoyed this article. In the next blog post, we will discuss some basic concepts of git through commands.

To install Git in a different platform, please refer below git documentation

To get more details on Git, please refer below git documentation


Leave a Reply

Close Menu