Set up Git LFS
Install Git LFS, point it at your LFS Harbor server, and push your first large file.
Install Git LFS
Install the Git LFS extension for your operating system.
brew install git-lfsInitialize Git LFS
Run this once per machine. It installs the Git hooks that intercept LFS-tracked files during git push and git pull.
git lfs installConfigure the LFS server URL
Tell Git which server handles LFS objects for this repository. Using .lfsconfig keeps the setting in version control so your team picks it up automatically.
git config -f .lfsconfig lfs.url YOUR_LFS_URL
git add .lfsconfigReplace YOUR_LFS_URL with the value shown on your repository page in the dashboard.
Add a credential helper
Git needs an access token to authenticate with LFS Harbor.
- Go to the LFS Harbor Dashboard.
- Click on your repository.
- Click Create token.
- Name the token and set the expiry.
- Copy the username and token value.
- Store the credentials with Git's credential helper:
git credential approve <<EOF
protocol=https
host=lfs.lfsharbor.com
username=YOUR_USERNAME
password=YOUR_ACCESS_TOKEN
EOFReplace YOUR_USERNAME and YOUR_ACCESS_TOKEN with the values from the dashboard. Git will use whichever credential store is configured on your machine (keychain on macOS, libsecret on Linux, Windows Credential Manager on Windows).
Track a file type
Tell Git LFS which files to manage. This writes a rule to .gitattributes — commit it so the whole team shares the same tracking rules.
git lfs track "*.psd"
git add .gitattributesYou can track multiple patterns. Run git lfs track once for each file type, or edit .gitattributes directly.
Commit and push
Add a tracked file, commit, and push as normal. Git LFS uploads the objects to LFS Harbor before updating the Git ref — pushes may take longer for large files.
git add your-file.psd
git commit -m "Add large file"
git pushThat's it. LFS Harbor now stores your large files and your Git history stays fast.