2018-03-27 19:54:05 +05:30
---
2020-10-24 23:57:45 +05:30
stage: Create
group: Source Code
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/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.'
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
2022-03-02 08:16:31 +05:30
To begin contributing to GitLab projects, you must install the appropriate Git client
on your computer. Information about [installing Git ](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git )
2019-09-04 21:01:54 +05:30
is also available at the official Git website.
2022-03-02 08:16:31 +05:30
## Supported operating systems
2020-05-24 23:13:21 +05:30
2022-03-02 08:16:31 +05:30
Git is available for the following operating systems:
2020-05-24 23:13:21 +05:30
2022-03-02 08:16:31 +05:30
- [macOS ](#macos )
- [Ubuntu Linux ](#ubuntu-linux )
- [Microsoft Windows ](#windows )
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
### macOS
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
A version of Git is supplied by macOS. You can use this version, or install the latest
version of Git on macOS by downloading it from the project website. We recommend
installing Git with [Homebrew ](https://brew.sh/index.html ). With Homebrew, you can
access an extensive selection of libraries and applications, with their dependencies
managed for you.
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
Prerequisites:
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
- 15 GB of available disk space for Homebrew and Xcode.
- Extra disk space for any additional development libraries.
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
To install Git on macOS:
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
1. Open a terminal and install the XCode Command Line Tools:
2020-05-24 23:13:21 +05:30
2022-03-02 08:16:31 +05:30
```shell
xcode-select --install
```
2020-05-24 23:13:21 +05:30
2022-03-02 08:16:31 +05:30
Alternatively, you can install the entire [XCode ](https://developer.apple.com/xcode/ )
package through the macOS App Store.
2019-09-04 21:01:54 +05:30
2022-03-02 08:16:31 +05:30
1. Select **Install** to download and install XCode Command Line Tools.
1. Install Homebrew according to the [official Homebrew installation instructions ](https://brew.sh/index.html ).
1. Install Git by running `brew install git` from your terminal.
1. In a terminal, verify that Git works on your computer:
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
```shell
git --version
```
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
### Ubuntu Linux
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
On Ubuntu and other Linux operating systems, use the built-in package manager
to install Git:
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
1. Open a terminal and run these commands to install the latest Git
from the officially
maintained package archives:
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
```shell
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
2022-03-02 08:16:31 +05:30
1. To verify that Git works on your computer, run:
2020-05-24 23:13:21 +05:30
2022-03-02 08:16:31 +05:30
```shell
git --version
```
2019-09-04 21:01:54 +05:30
2022-03-02 08:16:31 +05:30
### Windows
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
Go to the [Git website ](https://git-scm.com/ ), and then download and install Git for Windows.
2018-03-17 18:26:18 +05:30
2022-03-02 08:16:31 +05:30
## After you install Git
2019-09-04 21:01:54 +05:30
2022-06-21 17:19:12 +05:30
After you successfully install Git on your computer, read about [adding an SSH key to GitLab ](../../../user/ssh.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. -->