How to install git on linux

Installing Git

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

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.

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

Open a terminal and install the XCode Command Line Tools:

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

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

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

 apt-add-repository ppa:git-core/ppa  apt-get update  apt-get  git 

To verify that Git works on your computer, run:

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.

Help & feedback

Docs

Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.

Product

Create an issue if there’s something you don’t like about this feature.
Propose functionality by submitting a feature request.
Join First Look to help shape new features.

Feature availability and product trials

View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.

Читайте также:  Как открыть флешку в консоли линукс

Get Help

If you didn’t find what you were looking for, search the docs.

If you want help with something specific and could use community support, post on the GitLab forum.

For problems setting up or using this feature (depending on your GitLab subscription).

Источник

Установка и настройка Git

Git еще не является параметром по умолчанию на компьютерах, поэтому его необходимо установить и настроить вручную. И, как и другое программное обеспечение, важно поддерживать Git в актуальном состоянии. Обновления защититься от уязвимостей системы безопасности, исправить ошибки и предоставить доступ к новым функциям.

В следующих разделах описывается установка и обслуживание Git для трех основных платформ.

Установка Git для Windows

Загрузите и установите Git для Windows. После установки Git доступен из командной строки или PowerShell. Рекомендуется выбрать значения по умолчанию во время установки, если не есть веские основания для их изменения.

Git для Windows не обновляется автоматически. Чтобы обновить Git для Windows, скачайте новую версию установщика, которая обновляет Git для Windows и сохраняет все параметры.

Установка Git для macOS

macOS 10.9 (Mavericks) и более поздних версий устанавливает Git при первой попытке запустить его из терминала. Хотя этот метод является простым способом получения Git в системе, он не позволяет контролировать частоту применения обновлений или исправлений безопасности.

Вместо этого рекомендуется установить Git через Homebrew и использовать средства Homebrew для поддержания актуальности Git. Homebrew — отличный способ установки средств разработки открытый код и управления ими на компьютере Mac из командной строки.

Установите Homebrew и выполните следующую команду, чтобы установить последнюю версию Git на компьютере Mac:

Чтобы обновить установку Git, используйте параметр обновления Homebrew:

Графический установщик для Git в macOS также доступен на официальном веб-сайте Git.

Установка Git для Linux

Используйте собственную систему управления пакетами дистрибутива Linux для установки и обновления Git. Например, в Ubuntu:

Настройка Git в Linux

Настройте имя и адрес электронной почты перед началом работы с Git. Git присоединяет эти сведения к изменениям и позволяет другим пользователям определить, какие изменения принадлежат к каким авторам.

Выполните следующие команды из командной строки после установки Git, чтобы настроить эти сведения:

Visual Studio предлагает отличный встроенный интерфейс Git без дополнительных инструментов. Дополнительные сведения см. в этом руководстве по Visual Studio Git.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Читайте также:  Linux var lib usr

Install git illustration

How to install Git on any OS

Git can be installed on the most common operating systems like Windows, Mac, and Linux. In fact, Git comes installed by default on most Mac and Linux machines!

To see if you already have Git installed, open up your terminal application.

  • If you’re on a Mac, look for a command prompt application called «Terminal».
  • If you’re on a Windows machine, open the windows command prompt or «Git Bash».

Once you’ve opened your terminal application, type git version . The output will either tell you which version of Git is installed, or it will alert you that git is an unknown command. If it’s an unknown command, read further and find out how to install Git.

Install Git Using GitHub Desktop

Installing GitHub Desktop will also install the latest version of Git if you don’t already have it. With GitHub Desktop, you get a command line version of Git with a robust GUI. Regardless of if you have Git installed or not, GitHub Desktop offers a simple collaboration tool for Git. You can learn more here.

  1. Navigate to the latest Git for Windows installer and download the latest version.
  2. Once the installer has started, follow the instructions as provided in the Git Setup wizard screen until the installation is complete.
  3. Open the windows command prompt (or Git Bash if you selected not to use the standard Git Windows Command Prompt during the Git installation).
  4. Type git version to verify Git was installed.

Note: git-scm is a popular and recommended resource for downloading Git for Windows. The advantage of downloading Git from git-scm is that your download automatically starts with the latest version of Git included with the recommended command prompt, Git Bash . The download source is the same Git for Windows installer as referenced in the steps above.

Most versions of MacOS will already have Git installed, and you can activate it through the terminal with git version . However, if you don’t have Git installed for whatever reason, you can install the latest version of Git using one of several popular methods as listed below:

Читайте также:  Hp pavilion linux drivers

Install Git From an Installer

  1. Navigate to the latest macOS Git Installer and download the latest version.
  2. Once the installer has started, follow the instructions as provided until the installation is complete.
  3. Open the command prompt «terminal» and type git version to verify Git was installed.

Note: git-scm is a popular and recommended resource for downloading Git on a Mac. The advantage of downloading Git from git-scm is that your download automatically starts with the latest version of Git. The download source is the same macOS Git Installer as referenced in the steps above.

Install Git from Homebrew

Homebrew is a popular package manager for macOS. If you already have Homwbrew installed, you can follow the below steps to install Git:

  1. Open up a terminal window and install Git using the following command: brew install git .
  2. Once the command output has completed, you can verify the installation by typing: git version .

Fun fact: Git was originally developed to version the Linux operating system! So, it only makes sense that it is easy to configure to run on Linux.

You can install Git on Linux through the package management tool that comes with your distribution.

  1. Git packages are available using apt .
  2. It’s a good idea to make sure you’re running the latest version. To do so, Navigate to your command prompt shell and run the following command to make sure everything is up-to-date: sudo apt-get update .
  3. To install Git, run the following command: sudo apt-get install git-all .
  4. Once the command output has completed, you can verify the installation by typing: git version .
  1. Git packages are available using dnf .
  2. To install Git, navigate to your command prompt shell and run the following command: sudo dnf install git-all .
  3. Once the command output has completed, you can verify the installation by typing: git version .

Note: You can download the proper Git versions and read more about how to install on specific Linux systems, like installing Git on Ubuntu or Fedora, in git-scm’s documentation.

Other Methods of Installing Git

Looking to install Git via the source code? Learn more here.

Get started with git and GitHub

Review code, manage projects, and build software alongside 40 million developers.

Subscribe to our newsletter

Get product updates, company news, and more.

Источник

Оцените статью
Adblock
detector