Skip to content

Instantly share code, notes, and snippets.

@statik
Last active May 7, 2025 15:13
Show Gist options
  • Save statik/640aab79b41dae8d6190d38aec7054cf to your computer and use it in GitHub Desktop.
Save statik/640aab79b41dae8d6190d38aec7054cf to your computer and use it in GitHub Desktop.
setup git-lfs on Posit Workbench for a single user

This script will download git-lfs and install it into a user home directory. It also adjusts the path in .bashrc to look for files in $HOME/.local/bin. This will allow git to find the git-lfs plugin.

After restarting the terminal, git-lfs should be functional and git clone of datasets from huggingface will work as expected.

If you have already cloned the hugging face repo before installing git-lfs, you can run git lfs fetch and it should download the files using git-lfs.

#!/usr/bin/env bash
GIT_LFS_RAW_VERSION="3.6.1"
GIT_LFS_VERSION="v${GIT_LFS_RAW_VERSION}"
GIT_LFS_TAR="git-lfs-linux-amd64-${GIT_LFS_VERSION}.tar.gz"
GIT_LFS_URL="https://github.com/git-lfs/git-lfs/releases/download/${GIT_LFS_VERSION}/${GIT_LFS_TAR}"
wget $GIT_LFS_URL
tar -xvzf $GIT_LFS_TAR
mkdir -p .local
echo 'PATH=$PATH:$HOME/.local/bin'>> $HOME/.bashrc
./git-lfs-${GIT_LFS_RAW_VERSION}/install.sh --local
echo "restart your terminal to enable git-lfs in your path"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment