You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SSH protocol not correctly detected, leading to 'Unsupported protocol scheme' error #2255
It seems that for Git LFS to detect the SSH protocol, it is necessary to either provide ssh:// or use the username@host syntax. If the repository URL is lacking both, the first part of the hostname will be taken as the protocol name.
For example, somehost.com:myrepo.git might be a perfectly valid repository URL to clone from if my username is either identical or is provided through the ssh config.
In my case, I provide the SSH user name through my SSH config when cloning from BitBucket. The files tracked by LFS are not on the master branch, so I run into errors as soon as I checkout a branch that does.
So when cloning with git clone bitbucket.org:user/project, I get the following error when checking out the branch with files tracked by Git LFS:
git-lfs/2.2.0-pre (GitHub; linux amd64; go 1.8.1)
git version 2.13.0
$ git-lfs filter-process
Error downloading object: Assets/somemodel.fbx (...): Smudge error: Error downloading Assets/somemodel.fbx (...): batch response: Post bitbucket.org:user/project.git/info/lfs/objects/batch: unsupported protocol scheme "bitbucket.org"
Post bitbucket.org:user/project.git/info/lfs/objects/batch: unsupported protocol scheme "bitbucket.org"
...
Providing the username during cloning apparently makes the protocol being recognized (git is the user for all SSH connections on BitBucket): git clone [email protected]:user/project
Providing the protocol itself works as well: git clone ssh://bitbucket.org/user/project
Changing the URLs after cloning would also be a work-around, I assume, but I hope this is fixed for the sake of integrating Git LFS better with Git itself.
This was documented on Arch Linux, but I faintly remember running into similar issues on Windows a while ago that I did not further looked into back then.
I don't have time to address this right now, but I've milestoned this issue into the v2.2.0 milestone, so it should be addressed and fixed by the time that release is cut. In the meantime, you can work around this by providing an SSH username, using an HTTPs remote, or using the environment variable GIT_LFS_SKIP_SMUDGE to skip the checkout entirely.
I have just seen this issue while evaluating git LFS. I think it is stopping git-lfs from correctly using git-lfs-authenticate. I have never written any go before so apologies if this is somehow wrong.
We generally use ssh config with Gerrit here. e.g.
Host gerrit
HostName 192.168.1.1
Port 29418
User user.name
IdentityFile ~/.ssh/id_rsa
Using go default URL parsing "u.Scheme" comes out as "gerrit". I have a test program which can make the SSH aliases into bare SSH URLs.
package main
import "fmt"
import "net/url"
import "github.com/kevinburke/ssh_config"
func main() {
s := "gerrit:repo.git"
u, err := url.Parse(s)
if err != nil {
panic(err)
}
port, err := ssh_config.GetStrict(u.Scheme, "Port")
if err != nil {
panic(err)
}
hostname, err := ssh_config.GetStrict(u.Scheme, "HostName")
if err != nil {
panic(err)
}
user, err := ssh_config.GetStrict(u.Scheme, "User")
if err != nil {
panic(err)
}
output := s
if hostname != "" {
output = user + "@" + hostname + ":" + port
}
fmt.Println("Original: " + s)
fmt.Println("Parsed: " + output)
}
@hjmallon great find, and thank you for spending some time on this! I don't have time to work on this right now, but would be more than happy to help offer some pointers on how to integrate the snippet that you posted above (and with my comment in #2255 (comment)) into LFS.
Please let me know if this is something that you (or somebody else) would be interested, and we can get started.
Activity
ttaylorr commentedon May 23, 2017
👋 @krukai, thanks for opening this. I think the function that needs changing is this one, and in particular, these lines[1]:
I don't have time to address this right now, but I've milestoned this issue into the v2.2.0 milestone, so it should be addressed and fixed by the time that release is cut. In the meantime, you can work around this by providing an SSH username, using an HTTPs remote, or using the environment variable
GIT_LFS_SKIP_SMUDGEto skip the checkout entirely.hjmallon commentedon Sep 7, 2017
I have just seen this issue while evaluating git LFS. I think it is stopping git-lfs from correctly using git-lfs-authenticate. I have never written any go before so apologies if this is somehow wrong.
We generally use ssh config with Gerrit here. e.g.
Using go default URL parsing "u.Scheme" comes out as "gerrit". I have a test program which can make the SSH aliases into bare SSH URLs.
It requires ssh_config package.
https://godoc.org/github.com/kevinburke/ssh_config
https://github.com/kevinburke/ssh_config
This returns
This issue was mentioned in previous discussion of a different issue (#930)
ttaylorr commentedon Sep 8, 2017
@hjmallon great find, and thank you for spending some time on this! I don't have time to work on this right now, but would be more than happy to help offer some pointers on how to integrate the snippet that you posted above (and with my comment in #2255 (comment)) into LFS.
Please let me know if this is something that you (or somebody else) would be interested, and we can get started.
ttaylorr commentedon Jul 27, 2018
Moving to #278.