Install composer and git on Amazon AMI running on EC2
Table of Contents
Composer installation on AWS EC2 instance
$ cd ~ $ sudo curl -sS https://getcomposer.org/installer | sudo php $ sudo mv composer.phar /usr/local/bin/composer $ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
Git installation on AWS EC2 instance
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.
#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.