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.gz
file 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.gz
2.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/bin
in your home folder if that doesn't exist. Add Path.local/bin
path to terminal.
mkdir -p ~/.local/bin/
export PATH="$HOME/.local/bin:$PATH"
- Now you can run
./install.sh
to install git-lfs.
./install.sh
You should see Git LFS Initalized
.
- Check your installation:
git-lfs --version
- Add
.local/bin
to.bashrc
or whatever shell you use. This step is to make sure that your shell can findgit-lfs
binaries.
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 !