I am not so into Linux and I have the following problem.
I have entered via SSH into my Linux shell on a Bluehost server and doing:
git --version
I saw that I have a vary old version of git:
-jailshell-4.1$ git --version
git version 1.7.11.3
So I followed this guide to install a new version of GIT on my server: http://willjackson.org/blog/installing-git-bluehost-shared-hosting
So I have created the .local directory into my home directory and into it I have creaated the src directory where I have downloaded the last version of GIT doing:
wget --no-check-certificate https://github.com/git/git/archive/master.zip
I have unzipped this zip file and I have correctly done the make and make install statment. I have obtained no errors.
The problem is that doing git --version I still obtain the old git version 1.7.11.3 and not the newer installed one.
First I modified the .bashrc file putting this line at the end:
export PATH=$HOME/.local/bin:$HOME/.local/usr/bin:$PATH
but reading the comments to the previous tutorial I read that:
This actually doesn't work like seems... Bluehost has git installed by default in /usr/bin/git (as David Lichtenberg observed below). You can verify this by running which git from the command line.
The problem is that the version of git that Bluehost provides is pretty old (1.7.11.3). After following the steps above, running git --version will still report git version 1.7.11.3 meaning the latest version of git that you just downloaded isn't the one being used.
To remedy this you'll need change the export in your .bashrc (that you entered in step 4) to:
export PATH="$HOME/.local/src/git-master:$PATH"
Then just exit and log back in and you should be good to go. Running which git should return /[home]/[username]/.local/src/git-master/git.
So I have changed my .bashrc file as suggested in this comment, so now my .bashrc file contains:
# .bashrc
# User specific aliases and functions
# Source global definitions
# if [ -f /etc/bashrc ]; then
# . /etc/bashrc
#fi
export PATH="$HOME/.local/src/git-master:$PATH"
I think that this nw export version say to use the git version that is installed inside the $HOME/.local/src/git-master folder.
Where HOME is /home6/onofrior (the home directory of my server).
Then I have exit the ssh session and I log into again.
The problem is that doing git --version I still obtain the old git version 1.7.11.3 and not the last one installed, infacti this is the output:
-jailshell-4.1$ git --version
git version 1.7.11.3
If I directly execute ./git --version in the directory where the new version of GIT is correctly installed infact I obtain the expected output related to the last git version:
-jailshell-4.1$ pwd
/home6/onofrior/.local/src/git-master
-jailshell-4.1$ ./git --version
git version 2.10.0.GIT
So it means that the last version of GIT is correctly installed into my /home6/onofrior/.local/src/git-master directory.
I think that the problem is into the .bashrc file or somwthing related to how is specified what GIT version have to be used by the shell, in
Maybe the problem is that Bluehost is using this strange jailshell-4.1$ or something like this?
Why? What is wrong? What am I missing? How can I fix this issue?
Tnx