summaryrefslogtreecommitdiff
path: root/doc/topics/git/how_to_install_git/index.md
blob: 1eea49d8ffe57030aeaab173f6e6d42528496994 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
stage: Create
group: Source Code
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/#designated-technical-writers
description: 'This article describes how to install Git on macOS, Ubuntu Linux and Windows.'
type: howto
---

# Installing Git

To begin contributing to GitLab projects,
you will need to install the Git client on your computer.

This article will show you how to install Git on macOS, Ubuntu Linux and Windows.

Information on [installing Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
is also available at the official Git website.

## Install Git on macOS using the Homebrew package manager

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.

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.

### Installing Xcode

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.

### Installing Homebrew

With Xcode installed, browse to the [Homebrew website](https://brew.sh/index.html)
for the official Homebrew installation instructions.

### Installing Git via Homebrew

With Homebrew installed, you are now ready to install Git.
Open a terminal and enter the following command:

```shell
brew install git
```

Congratulations! You should now have Git installed via Homebrew.

To verify that Git works on your system, run:

```shell
git --version
```

Next, read our article on [adding an SSH key to GitLab](../../../ssh/README.md).

## Install Git on Ubuntu Linux

On Ubuntu and other Linux operating systems
it is recommended to use the built-in package manager to install Git.

Open a terminal and enter the following commands
to install the latest Git from the official Git maintained package archives:

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

Congratulations! You should now have Git installed via the Ubuntu package manager.

To verify that Git works on your system, run:

```shell
git --version
```

Next, read our article on [adding an SSH key to GitLab](../../../ssh/README.md).

## Installing Git on Windows from the Git website

Open the [Git website](https://git-scm.com/) and download and install Git for Windows.

Next, read our article on [adding an SSH key to GitLab](../../../ssh/README.md).

<!-- ## 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. -->