If you attempt to lock a Git LFS repository, you'll get a 404 Not Found response because the command is not yet supported by Artifactory. The problem is that this could lead you to believe that there's a configuration problem. With this said, Artifactory can imitate the file lock behavior via its user management and permissions handling capabilities.
As the permissions feature allows you to quickly change permissions on artifacts or paths, you can specify an exclude pattern for any permission that grants the Delete/Overwrite permission on your Git LFS repositories. To do this, start by getting the current permissions JSON using the Artifactory REST API:
curl -u <ADMIN>:<PASSWORD> -XGET https://<ART_UR>:<ART_PORT>/artifactory/api/security/permissions/<GIT_LFS_PERMISSION>
This will return a .json file containing the permission configuration. You need to then add a new line to the JSON:
"excludesPattern": "<ARTIFACT_PATH>"
and then upload the JSON to Artifactory as the same permission:
curl -u <ADMIN>:<PASSWORD> -X PUT -H “Content-type: Application/json” --data @upload.json https://<ART_UR>:<ART_PORT>/artifactory/api/security/permissions/<GIT_LFS_PERMISSION>
Note: The steps above can also be accomplished via a script.