Skip to content

Instantly share code, notes, and snippets.

@czadikem
Forked from derhuerst/intro.md
Last active May 24, 2021 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save czadikem/60a83a15bd6df93a44c1a0606544a9ae to your computer and use it in GitHub Desktop.
Save czadikem/60a83a15bd6df93a44c1a0606544a9ae to your computer and use it in GitHub Desktop.
Installing Git on Linux, Mac OS X and Windows

Installing Git on Linux

If your linux system is not listed then you will have to lookup how to install Git on it.

Determine on which Linux distribution your system is based on. See List of Linux distributions – Wikipedia for a list. Most Linux systems – including Ubuntu – are Debian-based.

Debian-based linux systems

Open a terminal window. Copy & paste the following into the terminal window and hit Return. You may be prompted to enter your password.

sudo apt update
sudo apt upgrade
sudo apt install git

You can use Git now.

Red Hat-based linux systems

Open a terminal. Copy & paste the following into the terminal window and hit Return. You may be prompted to enter your password.

sudo yum upgrade
sudo yum install git

You can use Git now.

Fedora-based linux systems

Open a terminal. Copy & paste the following into the terminal window and hit Return. You may be prompted to enter your password.

sudo dnf check-update
sudo dnf install git-all

You can use Git now.

Installing Git on a Mac

Open a terminal window.

Step 1 – Install Homebrew

Homebrew […] simplifies the installation of software on the Mac OS X operating system.

Homebrew – Wikipedia

Copy & paste the following into the terminal window and hit Return.

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

You will be offered to install the Command Line Developer Tools from Apple. Confirm by clicking Install. After the installation finished, continue installing Homebrew by hitting Return again.

Step 2 – Install Git

Copy & paste the following into the terminal window and hit Return.

brew install git

You can use Git now.

Installing Git on Windows

  1. Download Git from Git for Windows and install it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment