'How to add lfs support to this git setup?

I've set up my git repos like this: a bare repo on my HDD and a clone of it on my SSD. The bare repo is acting as a backup. Now I want to add lfs support to it and can't figure out how. I tried doing this in the clone repo:

git lfs install
git lfs track '*.png'

Now I create test.png in that directory.

git add .
git commit -m "added png file"
git push origin master

After running the last line I get this error:

Remote "origin" does not support the LFS locking API. Consider disabling it with:
$ git config lfs.D:/Git/test.git/info/lfs.locksverify false
batch request: missing protocol: "D:/Git/test.git/info/lfs"
error: failed to push some refs to 'D:/Git/test.git'

Doing git config lfs.D:/Git/test.git/info/lfs.locksverify false doesn't help. I think I'm misunderstanding how lfs sould be set up, but I couldn't find any tutorials on how to do it locally. I'm also not sure if it can even work without a server for lfs cache. Any help on how to set this up would be appreciated!



Solution 1:[1]

@alierdogan7: On Bitbucket, the LFS support is enabled in the repository settings (toothed wheel, lower left side)

Solution 2:[2]

Although this problem is older, my answer may help people still serching for such issue:

I had exactly the same problem. Then I saw that LFS is not enabled in the remote project that I cloned locally. After enbling , it seemed still not to work. But I had only to clone (again) after enabling... pushing lfs files worked.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Niels Kristian Jensen
Solution 2 user10587181