LFS HarborLFS Harbor

Set up Git LFS

Install Git LFS, point it at your LFS Harbor server, and push your first large file.

Prerequisites — you have Git installed, an LFS Harbor account, and a repository created in the dashboard.
1

Install Git LFS

Install the Git LFS extension for your operating system.

bash
brew install git-lfs
2

Initialize Git LFS

Run this once per machine. It installs the Git hooks that intercept LFS-tracked files during git push and git pull.

bash
git lfs install
3

Configure 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.

bash
git config -f .lfsconfig lfs.url YOUR_LFS_URL
git add .lfsconfig

Replace YOUR_LFS_URL with the value shown on your repository page in the dashboard.

4

Add a credential helper

Git needs an access token to authenticate with LFS Harbor.

  1. Go to the LFS Harbor Dashboard.
  2. Click on your repository.
  3. Click Create token.
  4. Name the token and set the expiry.
  5. Copy the username and token value.
  6. Store the credentials with Git's credential helper:
bash
git credential approve <<EOF
protocol=https
host=lfs.lfsharbor.com
username=YOUR_USERNAME
password=YOUR_ACCESS_TOKEN
EOF

Replace 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).

5

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.

bash
git lfs track "*.psd"
git add .gitattributes

You can track multiple patterns. Run git lfs track once for each file type, or edit .gitattributes directly.

6

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.

bash
git add your-file.psd
git commit -m "Add large file"
git push

That's it. LFS Harbor now stores your large files and your Git history stays fast.