Hi,
I'm new to Opalstack and trying to install a go app.
Unfortunately, I get an error saying "git fetch-pack: expected shallow list".
Apparently, the git version on my server too old (1.8.3.1)

How can I install a recent git version?

Cheers,
Matt

  • sean replied to this.

    ihle If you'd like to install a more recent version of git you can build it from source as whatever shell user like this:

    mkdir ~/src ~/tmp ~/opt ~/usr
    export TMPDIR=~/tmp
    cd ~/src
    wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.29.2.tar.gz
    tar zxf git-2.29.2.tar.gz
    cd git-2.29.2
    ./configure --prefix=$HOME/opt --mandir=$HOME/usr
    make
    make install
    export PATH=$HOME/opt/bin:$PATH

      worked like charm! thanks a lot

      17 days later

      sean I'm curious as to why we're running such an old version of git. I ran into a similar problem, I currently use git -C <path> pull in my deployment scripts, which I guess is not supported on 1.x. WF is using 2.29.2.

      I don't really want to have to install a recent git on each of my user accounts. Any hope of getting this upgraded?

      Also, what do you think about using

      wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.29.2.tar.gz

      instead? That's, from Oct 29, 2020, while 2.9.5 is from 2017. (Of course, if you look at the page https://mirrors.edge.kernel.org/pub/software/scm/git/, it's not sorted naturally, so 2.9.5 actually is at the end of the list 😆 )

      • sean replied to this.

        digitalmoksha We're running the version that's packaged with CentOS7.

        We'll be rolling out new servers in 2021 with CentOS8, those servers will have a newer version of git as the default install.

        digitalmoksha Also, what do you think about using

        wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.29.2.tar.gz

        Sure, go for it 🙂

          10 days later
          4 months later
          a year later

          sean should this still work?
          I have tried and it all seemed to install fine, but the git command still uses the old version.
          Do I need to uninstall the old version or something?
          Any help would be greatly appreciated.

          • sean replied to this.

            senrab did you run export PATH=$HOME/opt/bin:$PATH prior to running git?

              sean I thought I did but I ran it again and it works now. So obviously I didn't. Thank you.

                senrab Ok, note that the export command will only be valid for the current shell session.

                If you'd like that set automatically every time you log in, then add that same command to the end of the file /home/shelluser/.bash_profile in your shell user's home directory.

                Mastodon