Git LFS operations fail with error "unsupported protocol scheme (...)"
Problem
When performing a Git LFS operation, like for example "clone" or "smudge", the operation will throw an "unsupported protocol scheme" error.
Diagnosis
in the build log, or git-lfs log, or command output, the following message will be printed:
Error downloading object: src/test/Bigfile.img (7854894): Smudge error: Error downloading src/test/Bigfile.img (...): batch response: Post /data/bamboo/xml-data/build-dir/_git-repositories-cache/(...).git/info/lfs/objects/batch: unsupported protocol scheme ""
Cause
This is caused by a Git LFS bug in version 2.1.1 described here: https://github.com/git-lfs/git-lfs/issues/2255
Resolution
- Update the Git LFS client to the latest version.
- If the problem persists, try one of the workarounds offered in the bug definition:
Providing the username during cloning apparently makes the protocol being recognized (git is the user for all SSH connections on BitBucket):
git clone git@bitbucket.org:user/projectProviding the protocol itself works as well:
git clone ssh://bitbucket.org/user/projectChanging the URLs after cloning would also be a work-around