Instantly share code, notes, and snippets.

Embed
What would you like to do?
Installing Git on Linux, Mac OS X and Windows

Installing Git on Linux

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.

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.

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.

Installing Git on Windows

  1. Download Git from Git for Windows and install it.
@alhadhrami

This comment has been minimized.

Show comment
Hide comment
@alhadhrami

alhadhrami Nov 9, 2017

Wrong link in 'intro.md' for "Instructions for Windows". I was going to create a pull request, but then remembered that doesn't exist in gist.

alhadhrami commented Nov 9, 2017

Wrong link in 'intro.md' for "Instructions for Windows". I was going to create a pull request, but then remembered that doesn't exist in gist.

@rgnest

This comment has been minimized.

Show comment
Hide comment
@rgnest

rgnest Jan 6, 2018

You shoud before do "cd" the directrory should be yours home. Or will have error.
I mean macos.

rgnest commented Jan 6, 2018

You shoud before do "cd" the directrory should be yours home. Or will have error.
I mean macos.

@mithlesh4257

This comment has been minimized.

Show comment
Hide comment
@mithlesh4257

mithlesh4257 Jan 7, 2018

screenshot from 2018-01-07 22-15-52

Git is not installing in Ubuntu. Please help!

mithlesh4257 commented Jan 7, 2018

screenshot from 2018-01-07 22-15-52

Git is not installing in Ubuntu. Please help!

@elseagle

This comment has been minimized.

Show comment
Hide comment
@elseagle

elseagle Jan 18, 2018

@mithlesh4257 try
sudo apt-get update then sudo apt-get upgrade followed by sudo apt-get install git

elseagle commented Jan 18, 2018

@mithlesh4257 try
sudo apt-get update then sudo apt-get upgrade followed by sudo apt-get install git

@Kaarthick912

This comment has been minimized.

Show comment
Hide comment
@Kaarthick912

Kaarthick912 Mar 5, 2018

sudo yum upgrade

I ran this command and it removed all existing users. It upgraded like 450 packages and removed some users. Anybody know why this happened ?

Kaarthick912 commented Mar 5, 2018

sudo yum upgrade

I ran this command and it removed all existing users. It upgraded like 450 packages and removed some users. Anybody know why this happened ?

@Aztechtcs

This comment has been minimized.

Show comment
Hide comment
@Aztechtcs

Aztechtcs Mar 11, 2018

same problem here

Aztechtcs commented Mar 11, 2018

same problem here

@Joshua56

This comment has been minimized.

Show comment
Hide comment
@Joshua56

Joshua56 Mar 30, 2018

I am having the same problem in my linux mint

Joshua56 commented Mar 30, 2018

I am having the same problem in my linux mint

@Joshua56

This comment has been minimized.

Show comment
Hide comment
@Joshua56

Joshua56 Mar 30, 2018

zenity : Depends: libpango-1.0-0 (>= 1.14.0) but it is not going to be installed
Depends: zenity-common (= 3.18.1.1-1ubuntu2) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a s

This the error of the code

Joshua56 commented Mar 30, 2018

zenity : Depends: libpango-1.0-0 (>= 1.14.0) but it is not going to be installed
Depends: zenity-common (= 3.18.1.1-1ubuntu2) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a s

This the error of the code

@reddyvenu

This comment has been minimized.

Show comment
Hide comment
@reddyvenu

reddyvenu Apr 10, 2018

same problem here

reddyvenu commented Apr 10, 2018

same problem here

@imad-bouramana

This comment has been minimized.

Show comment
Hide comment
@imad-bouramana

imad-bouramana Apr 29, 2018

try this repository

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git

imad-bouramana commented Apr 29, 2018

try this repository

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git

@webbertakken

This comment has been minimized.

Show comment
Hide comment
@webbertakken

webbertakken Aug 15, 2018

I used this as a source for PracticalNotes - Homebrew.md because it is very efficient.

webbertakken commented Aug 15, 2018

I used this as a source for PracticalNotes - Homebrew.md because it is very efficient.

@oscrx

This comment has been minimized.

Show comment
Hide comment
@oscrx

oscrx Sep 13, 2018

Wrong link in 'intro.md' for "Instructions for Windows". I was going to create a pull request, but then remembered that doesn't exist in gist.

Exactly this :D
But thanks for the guide.

oscrx commented Sep 13, 2018

Wrong link in 'intro.md' for "Instructions for Windows". I was going to create a pull request, but then remembered that doesn't exist in gist.

Exactly this :D
But thanks for the guide.

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