debian-mirror-gitlab/doc/topics/git/how_to_install_git/index.md
2023-04-23 21:23:45 +05:30

3.7 KiB

stage group info description
Create Source Code 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 This article describes how to install Git on macOS, Ubuntu Linux and Windows.

Installing Git (FREE)

To begin contributing to GitLab projects, you must install the appropriate Git client on your computer. Information about installing Git is also available at the official Git website.

Supported operating systems

Git is available for the following operating systems:

macOS

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. With Homebrew, you can access an extensive selection of libraries and applications, with their dependencies managed for you.

Prerequisites:

  • 15 GB of available disk space for Homebrew and Xcode.
  • Extra disk space for any additional development libraries.

To install Git on macOS:

  1. Open a terminal and install the XCode Command Line Tools:

    xcode-select --install
    

    Alternatively, you can install the entire XCode package through the macOS App Store.

  2. Select Install to download and install XCode Command Line Tools.

  3. Install Homebrew according to the official Homebrew installation instructions.

  4. Install Git by running brew install git from your terminal.

  5. In a terminal, verify that Git works on your computer:

    git --version
    

macOS update

Periodically you may need to update the version of Git installed by Homebrew. To do so, open a terminal and run these commands:

brew update
brew upgrade git

To verify you are on the updated version, run git --version to display your current version of Git.

Ubuntu Linux

On Ubuntu and other Linux operating systems, use the built-in package manager to install Git:

  1. Open a terminal and run these commands to install the latest Git from the officially maintained package archives:

    sudo apt-add-repository ppa:git-core/ppa
    sudo apt-get update
    sudo apt-get install git
    
  2. To verify that Git works on your computer, run:

    git --version
    

Ubuntu Linux Update

Periodically it may be necessary to update Git installed. To do so, run the same commands.

Windows

Go to the Git website, and then download and install Git for Windows.

After you install Git

After you successfully install Git on your computer, read about adding an SSH key to GitLab.