MS Visual Studio + gitolite or github via ssh

2019-03-15 02:42发布

I have MSVS 2013 + git 1.8.4 + git-extensions 2.47.3 on local machine and gitolite 2.3-1 on remote server

I could clone commit and push my project (git@server.example.com:testproject) by console tools and via git-extension GUI

But I couldn't do the same from "Team Explorer" in MSVS. Even if I clone it manually (by console tool) and add as local repository to MSVS Team Explorer, I can't commit or push, because

An error occurred. Detailed message: An error was raised by libgit2. Category = Net (Error). This transport isn't implemented. Sorry

Everything I found related is about TFS or local git integration.

Same with github project.

Is it even possible to make it work? By some console hooks or something like that?

4条回答
手持菜刀,她持情操
2楼-- · 2019-03-15 03:04

As a workaround, I use git command prompt (invoked by clicking Open Command Prompt in Action dropdown on Team Explorer).

It already opens in the git repo directory, so pushing (after you have committed your changes locally) is as fast as invoking the command prompt and executing git push command, not much effort over clicking Sync. :)

查看更多
beautiful°
3楼-- · 2019-03-15 03:09

The "Team Explorer" uses the Git integration added with Visual Studio 2013.
See "Clone a remote Git repository from a third-party service".

With that Git native integration in Visual Studio, only https is supported.
Ssh isn't yet supported.

http://i.msdn.microsoft.com/dynimg/IC698706.png

This MSDN blog post stated in October 2013:

As of this writing, Visual Studio 2013 does not have support for ssh-based remotes.
If you have a Git remote that uses SSH and you try to perform a network operation in Visual Studio, you’ll get the message “This transport isn’t implemented. Sorry.” (This message comes from the libgit2 library.)
I don’t have a timeline for when support for SSH remotes might be implemented in Visual Studio.


Update Oct. 2015:

However, as Vladimir Koltunov mentions below, libgit2 is starting (Q4 2015) to be built (for VS 2015) with ssh support in project PROGrand/git2-msvstfs-ssh-patch.

This patch for 'libgit2' allows usage of SSH public/private keys pair with ssh repositories (such as gitolite) in Visual Studio 2015

查看更多
Rolldiameter
4楼-- · 2019-03-15 03:10

For Visual Studio 2015 it is possible to build SSH enabled version.

https://github.com/PROGrand/git2-msvstfs-ssh-patch

查看更多
我命由我不由天
5楼-- · 2019-03-15 03:21

I got this same message when the user had his repository mapped to a network drive & that drive wasn't mapped. So the only transports available (at least as of VS 2013) are http(s) and a filesystem, but if you use the filesystem and the drive isn't available, libgit tells you it doesn't support the transport.

查看更多
登录 后发表回答