Git LFS object repositories
Keep repositories and commits on your Git server. Arka handles Git LFS batch requests, object uploads, checksum verification, and downloads.
Create repositories
Run these Bash commands with an authenticated administrator arkactl profile and jq. Replace the endpoint and upstream address. Grant the publisher Hosted write access and the consumer read access to Group and the relevant members. For each identity, sign in and run arkactl --json tokens create --name gitlfs-ci --expires-in-days 30 | jq -er .plaintext. Store each token directly in your secret manager.
export ARKA_URL=https://packages.example.org
hosted=$(arkactl --json repo create --name gitlfs-hosted --type hosted --format gitlfs | jq -er .id)
proxy=$(arkactl --json repo create --name gitlfs-proxy --type proxy --format gitlfs \
--upstream-url https://git.example.org/team/project.git/info/lfs | jq -er .id)
arkactl repo create --name gitlfs-group --type group --format gitlfs --member "$hosted,$proxy"
export WRITE="$ARKA_URL/repository/gitlfs-hosted"
export READ="$ARKA_URL/repository/gitlfs-group"Configure and push
Git LFS obtains HTTPS Basic credentials from the Git credential helper. For writes, use an Arka username and token with Hosted write access. Supply credentials through CI or the operating system’s credential manager.
git lfs install --local
git config lfs.url "$READ"
git config lfs.pushurl "$WRITE"
git config "lfs.$WRITE.access" basic
git config lfs.locksverify false
git lfs track '*.bin'
git add .gitattributes model.bin
git commit -m 'Track model with Git LFS'
git lfs push origin HEADConfigure the consuming client with Basic credentials for each private Group or Hosted URL. Set lfs.locksverify=false only if the Git remote does not provide a separate file-lock service.
Pull and verify
GIT_LFS_SKIP_SMUDGE=1 git clone "$GIT_REMOTE" clean
git -C clean config lfs.url "$READ"
git -C clean lfs pull
sha256sum clean/model.binCompare the SHA-256 against oid sha256: in the LFS pointer for the same commit. Set the Proxy upstream to the Git LFS API root, typically the upstream Git project URL followed by /info/lfs. Group looks up objects by OID.
| Symptom | What to check |
|---|---|
| The file still contains an LFS pointer | Inspect the endpoint from git lfs env, the batch response, object access, and smudge settings. |
| Batch returns 200 but download fails | Check objects[].error or actions.download.href and verify the public URL and certificate. |
| Object size or OID mismatch | Check size and oid in the LFS pointer and retry upload and verify. |