Install git in non root user account

To Install and build git from source in a non-root user account download the source tarball from .For the current example i have used git-2.29.2.tar.gz on RHEL 8 version.

Login as a non root user and follow the below steps.

  • Create a directory under HOME
mkdir $HOME/git
  • Copy the source code tarball and un-tar inside the above directory
  tar -xvf git-2.29.2.tar.gz
  cd $HOME/git/git-2.29.2/

Go through the INSTALL file for detailed options to build the souce code.

  • Run install command from source directory
 ./configure --prefix=$HOME/git/git-2.29.2/
 make install

The git and its associated binaries will be created in the source path . Check the git version

  ./git --version
  git version 2.29.2
  • Update the PATH variable
export PATH=$PATH:$HOME/git/git-2.29.2/

One comment

  1. Can you please put a tutorial to install git from rpm packages

Leave a Reply