Installing Latest version of git in ubuntu

后端 未结 5 1335
傲寒
傲寒 2020-12-12 09:49

My Current git version 1.7.9.5...

I need to upgrade to at least git 1.7.10 to have git clone command to work properly

I tried sudo add-apt

相关标签:
5条回答
  • 2020-12-12 10:01

    The Ubuntu git maintainers team has a PPA just for that

    ppa:git-core/ppa
    

    Just do:

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

    If add-apt-repository command is not found, install it first with

    sudo apt-get install software-properties-common python-software-properties
    
    0 讨论(0)
  • 2020-12-12 10:08

    The question was: "What to do when sudo add-apt-repository ppa:git-core/ppa command fails".

    I had the same issue in a VM behind a proxy. I resolved it with the following two steps:

    1. Set up proxy environment variables

      export http_proxy=http://<user>:<pwd>@<proxy_url>:<port_number>
      export https_proxy=http://<user>:<pwd>@<proxy_url>:<port_number>
      
    2. Run the add-apt-repository command again as sudo with the -E option that preserves the user environment:

      sudo -E add-apt-repository ppa:git-core/ppa
      
    0 讨论(0)
  • 2020-12-12 10:09

    Just follow below commands to update latest version of git

    sudo add-apt-repository ppa:git-core/ppa -y
    sudo apt-get update
    sudo apt-get install git -y
    git --version
    
    0 讨论(0)
  • 2020-12-12 10:11

    or super manual method

    download git source from git hub and then

    make prefix=/usr/local all
    sudo make prefix=/usr/local install
    

    https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-14-04

    0 讨论(0)
  • 2020-12-12 10:24

    To install or update Git in the latest version of Ubuntu, simply type following command in terminal and hit enter (return).

    sudo apt-get install git
    

    For checking Git version.

    git --version 
    
    0 讨论(0)
提交回复
热议问题