Skip to main content
← All guides

Coordinate edits with file locking

Use the standard Git LFS lock commands for assets that cannot be merged safely.

Create and release a lock

Lock paths are relative to the repository root. Locks belong to the authenticated person or service token. Another writer cannot claim the same path while it is locked.

Agree on a team workflow: a lock coordinates writers but does not replace version control or guarantee that every editor will honor it.

git lfs lock path/to/asset.bin
git lfs locks
# Edit, commit, and push the asset, then release the lock.
git lfs unlock path/to/asset.bin

Recover a stale lock

Contact the lock owner first. Organization owners and admins can force-unlock from the repository page or use the standard CLI force option with an authorized personal token. Releasing another person's lock can discard coordination they still rely on; confirm their work is safe first.

git lfs unlock --force path/to/asset.bin

Migration and automation

File locks are independent of LFS object content and are not copied by git lfs fetch or git lfs push. Recreate any required locks during a coordinated migration. Prefer a dedicated service token per automation so ownership remains understandable.

Open your workspace