Linux обновить версию git

YuMS / update-git.sh

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

#! /bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y

I am quite new to using Linux and I came across these commands while searching for «updating git ubuntu».
Now I want to know exactly what these lines do?
espicially this one -> sudo add-apt-repository -y ppa:git-core/ppa
this probably updates everything in the repository (sudo apt-get update) [correct me if I am wrong pretty please]
sudo apt-get install git -y (not sure what the -y flag does here)

Works like a charm. Thanks

After 6 years, still working properly, Thanks.

Thanks! I needed this for ubuntu 18.04

Works like a charm, thanks!

Just what I was looking for. Thanks!

Thanks. Still working smoothly after 7 years.

WSL 2, Ubuntu 18.04, 04.2023
Still working, thanks.

Tried to run on Ubuntu 16.4 but getting below message,
The following packages have unmet dependencies: git : Depends: libpcre2-8-0 but it is not going to be installed Depends: git-man (> 1:2.41.0) but 1:2.7.4-0ubuntu1.9 is to be installed google-chrome-stable : Depends: libu2f-udev but it is not installable Depends: libvulkan1 but it is not going to be installed zoom : Depends: libxcb-xinerama0 but it is not going to be installed E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

Источник

How to Update Git

Git is a version control system that allows multiple developers to work on the same project while tracking changes and revisions. Keeping Git up to date brings you the latest features and usability improvements.

In this tutorial, you will learn how to update to the latest version of Git on Linux, Windows, and macOS.

How to update Git

  • A system running Linux, Windows, or macOS
  • An installed version of Git
  • Access to the terminal window (Linux, macOS) or command prompt (Windows)
  • An account with administrator-level privileges

How to Check the Current Git Version?

To check the current version of Git, use the following command:

Читайте также:  Checking port status in linux

This command works on all operating systems. This example uses Windows:

Checking the current version of Git using the Windows command prompt

How to Update Git

Below, we list different ways you can update your version of Git, depending on the operating system you are using. Skip to the section applicable for your machine.

Update Git on Linux

Note: To update Git on a Linux machine, use the appropriate package manager. When working with Git on CentOS, use a package manager such as yum or pacman .

This example shows how to update Git on Ubuntu.

Start by updating the system packages with the following command:

When prompted, type Y and press Enter to confirm the installation.

Installing the latest version of Git on Linux

To verify the installation has completed, check the Git version one more time:

Checking the current Git version after installing

Another way to update Git on Linux is to install it from scratch using the original source code. Check out our guide to installing Git on Ubuntu for details.

Update Git on Windows

The method you use to update Git on Windows depends on the version of Git you are currently running.

For versions prior to 2.14.1, uninstall Git from your system and install a copy of the latest version from scratch. Check out our guide to installing Git on Windows for more details.

For versions from 2.14.2 to 2.16.1, use the following command in your command prompt:

For versions 2.16.1 on, update Git with:

Updating Git using the Windows command prompt

The output above appears when you are running the latest Git version.

Update Git on Mac

The easiest way to update Git on Mac is to use the official installer. Download the installation file from the Git website. Run the installation and follow the install wizard to update Git to the latest version.

Note: Using the install wizard to update Git overwrites the current installation.

Another method is to update Git using Homebrew. If you don’t have Homebrew already, install it by using:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update Homebrew to make sure you have the latest installation packages:

Install the latest version of Git with Homebrew:

If you already have Git installed using Homebrew, update to the latest version with:

Check the current Git version to confirm the update:

Note: If checking the Git version after updating results in an output that includes (Apple Git-101) , your system is still running the default Apple version of Git instead of the official one. Change your local path to the Homebrew version of Git to fix this issue:
export PATH=/usr/local/bin:$PATH

Читайте также:  Tl wn821n v6 kali linux

After following this tutorial, you should have a fully updated version of Git installed on a Linux, Windows, or macOS machine.

Take a look at our Git Commands Cheat Sheet for a comprehensive primer on working with Git. If you come across a Git merge conflict, make sure to read our article How to Resolve Merge Conflicts in Git.

Источник

Как поставить последнюю версию git?

У меня веб-сервер на debian поставил git через apt-get install git поставилась версия 2.1.4 но на хабре была статья про версию 2.7 и в ней есть несколько интересных фишек, которые меня заинтересовали. Как правильно обновить git на сервере до последней версии? Нужно свежие репозитории вручную добавлять? И как перед установкой узнать какая версия установится?

3 ответа 3

судя по информации о пакете git в разных релизах дистрибутива debian gnu/linux, у вас стоит релиз jessie (доступная версия пакета: 1:2.1.4-2.1+deb8u4 . символы 1: означают «эпоху», это «внутренняя кухня» пакетирования, upstream-версия программы здесь — 2.1.4 ). уточнить версию релиза можно командой:

$ lsb_release -rc Release: 8.9 Codename: jessie 

если программа lsb_release отсутствует, то можно просто посмотреть файлы в /etc такой, например, командой (пример вывода как раз на системе с релизом jessie):

$ cat /etc/*release* PRETTY_NAME="Debian GNU/Linux 8 (jessie)" NAME="Debian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=debian HOME_URL="http://www.debian.org/" SUPPORT_URL="http://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" 

путей поставить более новую версию программы много. наименее «болезненный» — подключить репозиторий jessie-backports и установить имеющуюся там версию 1:2.11.0-3~bpo8+1 .

согласно инструкциям с сайта backports.debian.org:

    надо добавить описание репозитория:

$ echo "deb http://mirror.yandex.ru/debian jessie-backports main" | sudo tee /etc/apt/sources.list.d/jbp.list 

теперь будет доступна для установки более новая версия пакета git (в данном случае — 1:2.11.0-3~bpo8+1 0 ):

$ apt-cache policy git git: Installed: (none) Candidate: 1:2.1.4-2.1+deb8u4 Version table: 1:2.11.0-3~bpo8+1 0 100 http://mirror.yandex.ru/debian/ jessie-backports/main amd64 Packages 1:2.1.4-2.1+deb8u4 0 500 http://security.debian.org/ jessie/updates/main amd64 Packages 1:2.1.4-2.1+deb8u3 0 500 http://deb.debian.org/debian/ jessie/main amd64 Packages 
$ sudo apt-get install --no-install-recommends -t=jessie-backports git=1:2.11.0-3~bpo8+1 
  • —no-install-recommends — не ствить пакеты, рекомендумые в устанавливаемом пакете (на сервере имеет смысл всегда пользоваться такой опцией или даже настроить apt на такое умолчальное поведение)
  • -t=jessie-backports — брать при необходимости пакеты из репозитория jessie-backports
  • git=1:2.11.0-3~bpo8+1 — установить пакет git именно указанной версии

в конце концов проверяем, что же установилось:

$ git --version git version 2.11.0 

Источник

Как проверить и обновить версию Git

Логотип Git на синем фоне

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

Читайте также:  Remove linux image debian

Проверьте, какую версию Git вы используете

Команда для проверки того, какую версию Git вы используете, одинакова как для Windows, так и для Mac. Чтобы проверить свою версию Git, откройте Командная строка (Windows), терминал (Mac) или терминал Linux.

Программы для Windows, мобильные приложения, игры — ВСЁ БЕСПЛАТНО, в нашем закрытом телеграмм канале — Подписывайтесь:)

После открытия запустите эту команду:

Запустите команду, чтобы проверить свою версию Git.

Будет возвращена текущая версия Git.

Ваша версия Git.

Теперь, когда вы знаете, какую версию Git используете, вы можете решить, хотите вы ее обновить или нет.

Как обновить Git в Windows

Команда, которую вы используете для обновления Git в Windows, зависит от того, какую версию Git вы используете в данный момент. Если вы используете любую версию от 2.14.2 до 2.16.1, запустите эту команду в командной строке:

Если вы используете любую версию после 2.16.1, вам нужно будет вместо этого запустить эту команду:

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

Команда для обновления Git в Windows и сообщение об успешном завершении.

Если вы используете версию более раннюю, чем 2.14.2, вам необходимо получить последнюю версию установщика из портал загрузки и обновите свою версию Git так же, как при первой установке Git.

Как обновить Git на Mac

Вы можете обновить Git из Терминала на Mac, используя Домашнее пиво, популярный менеджер пакетов для Mac. Скорее всего, у вас уже установлен Homebrew, если вы используете Git на своем Mac, но если нет, вы можете установить Homebrew, выполнив эту команду, а затем следуя инструкциям в Терминале:

/ bin / bash -c «$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)»

При установленном Homebrew запустите эту команду из Терминала, чтобы обновить Git:

Команда для обновления Git на Mac.

Если вы не используете последнюю версию Homebrew, сначала обновится Homebrew. По завершении Git обновится.

В качестве альтернативы вы можете перейти к Git’s портал загрузки и получите последнюю версию установщика.

Как обновить Git в Linux

Если вы используете Git в Linux, Git будет автоматически обновляться всякий раз, когда вы применяете обновление системы. Если вы не знаете, как это сделать, ознакомьтесь с нашими руководствами по обновление Ubuntu и обновление Arch Linux.

С Git можно делать так много интересных вещей, например, устанавливать программное обеспечение или клонировать репозиторий GitHub для работы над проектом. Постоянное обновление Git гарантирует, что у вас всегда будут самые свежие функции, которые Git может предложить.

Программы для Windows, мобильные приложения, игры — ВСЁ БЕСПЛАТНО, в нашем закрытом телеграмм канале — Подписывайтесь:)

Источник

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