Skip to content

Instantly share code, notes, and snippets.

@ahmadawais
Last active October 22, 2017 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ahmadawais/2a751e12b7143bb811afb3168a370461 to your computer and use it in GitHub Desktop.
Save ahmadawais/2a751e12b7143bb811afb3168a370461 to your computer and use it in GitHub Desktop.
GIT: How to Install Git on your Mac, Linux, or Windows!

🔥 Installing Git – the easy way

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. – The Git website


â–¶ Install Git on MacOS or OSX

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.

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
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.


â–¶ Install Git on Windows OS.

Just download Git from Git for Windows and install it.


â–¶ Install Git on Linux OS.

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-get update
sudo apt-get upgrade
sudo apt-get 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.

@arximughal
Copy link

sudo apt-get upgrade would actually start an upgrade for every package installed on the system and if some one's got a whole bunch of them, that might take considerable amount of time.
Just copy & paste the below line and git should be installed.

sudo apt-get update && sudo apt-get install git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment