Skip to content

Instantly share code, notes, and snippets.

@pourmand1376
Last active April 28, 2024 02:43
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save pourmand1376/bc48a407f781d6decae316a5cfa7d8ab to your computer and use it in GitHub Desktop.
Save pourmand1376/bc48a407f781d6decae316a5cfa7d8ab to your computer and use it in GitHub Desktop.
Single User Installation of Git-LFS without sudo

I wanted to install GIT-Lfs on my user account without access to server root account. I write this to my future self.

  1. 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
  1. Go to directory
cd git-lfs-3.2.0/
  1. give permission to file install.sh
chmod +x install.sh
  1. Edit file install.sh and change prefix from /usr/local/ to $YOUR_HOME/.local/bin.
  2. Do not forget to create .local/bin in your home folder if that doesn't exist.
  3. Now you can run ./install.sh to install git-lfs.
  4. Add .local/bin to .bashrc or whatever shell you use. This step is to make sure that your shell can find git-lfs binaries.
@DanRunfola
Copy link

Thank you, past self.

@adipill04
Copy link

After doing this, is access to the command "git lfs" possible? I have made sure my env variables and .bashrc file are all configured correctly, and ran install.sh as "./install.sh".

@G-Thor
Copy link

G-Thor commented Mar 8, 2024

The current (v.3.4.1) version of the installation script appends "/bin" to the prefix after it is declared so changing prefix="$YOUR_HOME/.local/bin" to prefix="$YOUR_HOME/.local" may solve the problem for @adipill04

@adipill04
Copy link

The current (v.3.4.1) version of the installation script appends "/bin" to the prefix after it is declared so changing prefix="$YOUR_HOME/.local/bin" to prefix="$YOUR_HOME/.local" may solve the problem for @adipill04

@G-Thor That sure was the problem-- there was a mismatch between PATH variable & the actual path I had installed git lfs in. Thanks for your help!

@zimingH
Copy link

zimingH commented Apr 9, 2024

Wow, thank you so much! I also encountered the "./local/bin" issue. Thank you all!

@Mao-KU
Copy link

Mao-KU commented Apr 24, 2024

Thank you, past self.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment