I wanted to install GIT-Lfs on my user account without access to server root account. I write this to my future self.
- Download
tar.gzfile from git-lfs website.
wget https://github.com/git-lfs/git-lfs/releases/download/v3.2.0/git-lfs-linux-amd64-v3.2.0.tar.gz2.Untar it
tar xvf git-lfs-linux-amd64-v3.2.0.tar.gz- Go to directory
cd git-lfs-3.2.0/- give permission to file
install.sh
chmod +x install.sh- Edit file install.sh and change prefix from
/usr/local/to$HOME/.local(Fix bug that @G-Thor has mentioned)
sed -i 's|^prefix="/usr/local"$|prefix="$HOME/.local"|' install.sh- Do not forget to create
.local/binin your home folder if that doesn't exist. Add Path.local/binpath to terminal.
mkdir -p ~/.local/bin/
export PATH="$HOME/.local/bin:$PATH"- Now you can run
./install.shto install git-lfs.
./install.shYou should see Git LFS Initalized.
- Check your installation:
git-lfs --version- Add
.local/binto.bashrcor whatever shell you use. This step is to make sure that your shell can findgit-lfsbinaries.
All in one (just copy and paste into terminal):
wget https://github.com/git-lfs/git-lfs/releases/download/v3.2.0/git-lfs-linux-amd64-v3.2.0.tar.gz
tar xvf git-lfs-linux-amd64-v3.2.0.tar.gz
cd git-lfs-3.2.0/
chmod +x install.sh
sed -i 's|^prefix="/usr/local"$|prefix="$HOME/.local"|' install.sh
mkdir -p ~/.local/bin/
export PATH="$HOME/.local/bin:$PATH"
./install.sh
git-lfs --version
Thank you !