Install Git on any operating system


Reading time: 15 minutes | Installation time: 2 minutes

The first step towards getting started with Git is to install it on your local machine. The process is simple and takes a few minutes and the commands to do so vary for various operating system. We have covered the commands to install git for the following operating systems:

  • Ubuntu
  • RHEL
  • OpenSUSE/ SLES/ SLED
  • Windows
  • MacOS
  • Fedora

Install Git on Ubuntu

sudo apt-get update
sudo apt-get install git-core
git --version

Install Git on RHEL

sudo yum update
sudo yum install git 
git --version

Install Git on OpenSUSE / SLES / SLED

zypper in git-core
git --version

Install Git on Windows

Go to https://git-scm.com/download/win and the download will start automatically. Double click on the downloaded file and follow the installation instructions.

Install Git on MacOS

Install XCode and type the following command:

git --version

If git is not installed, it will prompt to install it and follow the installation steps.

Install Git on Fedora

dnf -y update
dnf -y install git
git --version

Configuration

Once you have installed Git on your machine, you need to configure it.

git config --global user.name "your_username"
git config --global user.email "your_email@email_service.com"
git config --list