简体   繁体   中英

How do I update git to the latest version?

I'm Japanese boy.

I am using git version 2.1.4 on GCE.

$ git --version
git version 2.1.4

I'd like to update to the latest version, but it was not updated when I executed the following command.

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

Is my way wrong?


After that,I tried the following but it got an error.

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

The following error has occurred.

W: ppa.launchpad.net/git-core/candidate/ubuntu/dists/jessie/mai‌​n/… 404 Not Found
W: ppa.launchpad.net/git-core/ppa/ubuntu/dists/jessie/main/… 404 Not Found

I found out how to fix with ubuntu, but do you know how to fix GCE (debian)?

Add the Git Maintainers repository to get the latest Git version.

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

In ubuntu 16.04 the following worked for me. before running the below commands my git version is 2.7, now it's the latest version

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM