2018-02-16 13:01:35 -05:00
|
|
|
---
|
|
|
|
author: Sean Packham
|
|
|
|
author_gitlab: SeanPackham
|
|
|
|
level: beginner
|
|
|
|
article_type: user guide
|
|
|
|
date: 2017-05-15
|
2018-05-09 07:07:11 -04:00
|
|
|
description: 'This article describes how to install Git on macOS, Ubuntu Linux and Windows.'
|
2019-06-06 02:56:58 -04:00
|
|
|
type: howto
|
|
|
|
last_updated: 2019-05-31
|
2018-02-16 13:01:35 -05:00
|
|
|
---
|
2018-01-10 12:10:38 -05:00
|
|
|
|
2018-02-16 13:01:35 -05:00
|
|
|
# Installing Git
|
2018-01-10 12:10:38 -05:00
|
|
|
|
2019-06-06 02:56:58 -04:00
|
|
|
To begin contributing to GitLab projects,
|
2018-01-10 12:10:38 -05:00
|
|
|
you will need to install the Git client on your computer.
|
2019-06-06 02:56:58 -04:00
|
|
|
|
2018-01-10 12:10:38 -05:00
|
|
|
This article will show you how to install Git on macOS, Ubuntu Linux and Windows.
|
|
|
|
|
2019-06-06 02:56:58 -04:00
|
|
|
Information on [installing Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
|
|
|
|
is also available at the official Git website.
|
|
|
|
|
2018-01-10 12:10:38 -05:00
|
|
|
## Install Git on macOS using the Homebrew package manager
|
|
|
|
|
|
|
|
Although it is easy to 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 it via Homebrew to get access to
|
2018-01-19 05:09:59 -05:00
|
|
|
an extensive selection of dependency managed libraries and applications.
|
2018-01-10 12:10:38 -05:00
|
|
|
|
|
|
|
If you are sure you don't need access to any additional development libraries
|
2019-06-06 02:56:58 -04:00
|
|
|
or don't have approximately 15gb of available disk space for Xcode and Homebrew,
|
2018-11-19 08:51:54 -05:00
|
|
|
use one of the aforementioned methods.
|
2018-01-10 12:10:38 -05:00
|
|
|
|
|
|
|
### Installing Xcode
|
|
|
|
|
|
|
|
Xcode is needed by Homebrew to build dependencies.
|
|
|
|
You can install [XCode](https://developer.apple.com/xcode/)
|
|
|
|
through the macOS App Store.
|
|
|
|
|
|
|
|
### Installing Homebrew
|
|
|
|
|
2019-10-11 08:06:29 -04:00
|
|
|
Once Xcode is installed browse to the [Homebrew website](https://brew.sh/index.html)
|
2018-01-10 12:10:38 -05:00
|
|
|
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 in the following command:
|
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2018-01-10 12:10:38 -05:00
|
|
|
brew install git
|
|
|
|
```
|
|
|
|
|
|
|
|
Congratulations you should now have Git installed via Homebrew.
|
2019-06-06 02:56:58 -04:00
|
|
|
|
2018-01-10 12:10:38 -05:00
|
|
|
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 in the following commands
|
|
|
|
to install the latest Git from the official Git maintained package archives:
|
|
|
|
|
2020-01-30 10:09:15 -05:00
|
|
|
```shell
|
2018-01-10 12:10:38 -05:00
|
|
|
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.
|
2019-06-06 02:56:58 -04:00
|
|
|
|
2018-01-10 12:10:38 -05:00
|
|
|
Next read our article on [adding an SSH key to GitLab](../../../ssh/README.md).
|
|
|
|
|
|
|
|
## Installing Git on Windows from the Git website
|
|
|
|
|
|
|
|
Browse to the [Git website](https://git-scm.com/) and download and install Git for Windows.
|
2019-06-06 02:56:58 -04:00
|
|
|
|
2018-01-10 12:10:38 -05:00
|
|
|
Next read our article on [adding an SSH key to GitLab](../../../ssh/README.md).
|
2019-06-06 02:56:58 -04:00
|
|
|
|
|
|
|
<!-- ## 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. -->
|