2018-03-27 19:54:05 +05:30
---
2020-10-24 23:57:45 +05:30
stage: Create
group: Source Code
2021-02-22 17:27:13 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2018-11-08 19:23:39 +05:30
description: 'This article describes how to install Git on macOS, Ubuntu Linux and Windows.'
2019-09-04 21:01:54 +05:30
type: howto
2018-03-27 19:54:05 +05:30
---
2018-03-17 18:26:18 +05:30
2021-03-11 19:13:27 +05:30
# Installing Git **(FREE)**
2018-03-17 18:26:18 +05:30
2019-09-04 21:01:54 +05:30
To begin contributing to GitLab projects,
2018-03-17 18:26:18 +05:30
you will need to install the Git client on your computer.
2019-09-04 21:01:54 +05:30
2018-03-17 18:26:18 +05:30
This article will show you how to install Git on macOS, Ubuntu Linux and Windows.
2019-09-04 21:01:54 +05:30
Information on [installing Git ](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git )
is also available at the official Git website.
2018-03-17 18:26:18 +05:30
## Install Git on macOS using the Homebrew package manager
2020-11-24 15:15:51 +05:30
Although you can use the version of Git shipped with macOS or install the latest
version of Git on macOS by downloading it from the project website, we recommend
installing Git with Homebrew to get access to an extensive selection of
dependency-managed libraries and applications.
2018-03-17 18:26:18 +05:30
2020-11-24 15:15:51 +05:30
If you don't need access to any additional development libraries or don't have
approximately 15 GB of available disk space for Xcode and Homebrew, use one of
the previously mentioned methods.
2018-03-17 18:26:18 +05:30
### Installing Xcode
2020-05-24 23:13:21 +05:30
To build dependencies, Homebrew needs the XCode Command Line Tools. Install
it by running in your terminal:
```shell
xcode-select --install
```
Click **Install** to download and install it. Alternatively, you can install
the entire [XCode ](https://developer.apple.com/xcode/ ) package through the
macOS App Store.
2018-03-17 18:26:18 +05:30
### Installing Homebrew
2020-05-24 23:13:21 +05:30
With Xcode installed, browse to the [Homebrew website ](https://brew.sh/index.html )
2018-03-17 18:26:18 +05:30
for the official Homebrew installation instructions.
### Installing Git via Homebrew
2020-05-24 23:13:21 +05:30
With Homebrew installed, you are now ready to install Git.
Open a terminal and enter the following command:
2018-03-17 18:26:18 +05:30
2020-03-13 15:44:24 +05:30
```shell
2018-03-17 18:26:18 +05:30
brew install git
```
2020-05-24 23:13:21 +05:30
Congratulations! You should now have Git installed via Homebrew.
To verify that Git works on your system, run:
```shell
git --version
```
2019-09-04 21:01:54 +05:30
2020-05-24 23:13:21 +05:30
Next, read our article on [adding an SSH key to GitLab ](../../../ssh/README.md ).
2018-03-17 18:26:18 +05:30
## Install Git on Ubuntu Linux
On Ubuntu and other Linux operating systems
2020-05-24 23:13:21 +05:30
it is recommended to use the built-in package manager to install Git.
2018-03-17 18:26:18 +05:30
2020-05-24 23:13:21 +05:30
Open a terminal and enter the following commands
2018-03-17 18:26:18 +05:30
to install the latest Git from the official Git maintained package archives:
2020-03-13 15:44:24 +05:30
```shell
2018-03-17 18:26:18 +05:30
sudo apt-add-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
```
2020-05-24 23:13:21 +05:30
Congratulations! You should now have Git installed via the Ubuntu package manager.
To verify that Git works on your system, run:
```shell
git --version
```
2019-09-04 21:01:54 +05:30
2020-05-24 23:13:21 +05:30
Next, read our article on [adding an SSH key to GitLab ](../../../ssh/README.md ).
2018-03-17 18:26:18 +05:30
## Installing Git on Windows from the Git website
2020-05-24 23:13:21 +05:30
Open the [Git website ](https://git-scm.com/ ) and download and install Git for Windows.
2019-09-04 21:01:54 +05:30
2020-05-24 23:13:21 +05:30
Next, read our article on [adding an SSH key to GitLab ](../../../ssh/README.md ).
2019-09-04 21:01:54 +05:30
<!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
one might have when setting this up, or when something is changed, or on upgrading, it's
important to describe those, too. Think of things that may go wrong and include them here.
This is important to minimize requests for support, and to avoid doc comments with
questions that you know someone might ask.
Each scenario can be a third-level heading, e.g. `### Getting error message X` .
If you have none to add when creating a doc, leave this section in place
but commented out to help encourage others to add to it in the future. -->