我正在使用 NGit api 连接到 git 存储库并对其进行操作。
我有一个案例,我想连接到我在本地 TFS 上托管的 git 存储库。我创建了 ssh 密钥,将其插入到存储库中,一切顺利。但是当我想克隆存储库时,我从JGitInternalException收到一条消息说
ssh://servername:22/tfs/DefaultCollection/_git/gitrepo:未给出用户名
我假设我必须使用包含用户名的 url,就像本文定义的那样https://docs.microsoft.com/en-us/vsts/git/use-ssh-keys-to-authenticate?view=vsts
例如 ssh://username@servername:22/tfs/DefaultCollection/_git/gitrepo 左右,但是当我在浏览器中单击“克隆 repo”时,我只得到第一个 URL。
或者我应该更改 JschConfigSessionFactory 中的某些内容。任何帮助或解决方法将不胜感激。