I'm running Git LFS 3.1.1. My .gitattributes file has the following:
*.png filter=lfs diff=lfs merge=lfs -text
However when I do the following (Test.png is already pushed if that matters):
>git lfs lock Test.png
Locked Test.png
>git lfs locks
Test.png MrBoy ID:2
Surely git lfs lock
should fail in this case since lockable
is not an attribute? Is this a limitation/bug or a misunderstanding on my part?
Git LFS allows you to lock any file. The lockable
attribute controls whether files in the tree are read-only unless locked when that option is enabled, nothing more.
The reason is that users have many different workflows and Git LFS tries not to dictate workflow very much. Also, by design, Git LFS servers may run independent of access to the repository, and so the server may or may not actually know whether the file is lockable. It is, of course, possible to build a server which does have that knowledge and which rejects this behavior, but I'm not aware of any that do.