所以我的问题是如何设置SSH隧道来在防火墙后面使用git协议。具体来说,我需要在防火墙后面执行git clone git://gitorious / ...(不是ssh://,不是http://)。 Thanks!
解决方案git:// 协议在端口9418上运行(记录在 git-daemon 手册页中,或运行 git daemon --help )。要通过SSH隧道转发,请执行以下操作:
ssh -L 9418:gitorious:9418您的.remote.host连接之后,您可以像这样克隆远程存储库:
git clone git://localhost/path/to/repository.git为了达到这个目的,你显然需要防火墙外的机器作为ssh命令的目标。
I know similar questions have been asked many times. But all I can find are answers about how to setup proxy for http or ssh protocols. Here is the situation. For some reason, the git repository on gitorious I need to clone doesn't allow http or ssh. When I use "git clone gitorious/...." I got ".../refs not found: did you run git update-server-info on the server?" error. If I use "git clone ssh://git@gitorious/...", I got "fatal: The remote end hung up unexpectedly" error. (probably I should blame android "repo" for this one, because I can do git clone directly, but not through "repo sync"). (The above tests are all done without firewall.)
So my question is how to setup SSH tunnel to use git protocol behind a firewall. Specifically, I need to do "git clone git://gitorious/..." (not ssh://, not ) behind firewall. Thanks!
解决方案The git:// protocol operates on port 9418 (documented in the git-daemon man page, or run git daemon --help). To forward this via an SSH tunnel, you would do something like this:
ssh -L 9418:gitorious:9418 your.remote.hostOnce connected, you would clone a remote repository like this:
git clone git://localhost/path/to/repository.gitIn order for this to work you obviously need a machine outside your firewall to be the target of the ssh command.
更多推荐
如何使用SSH隧道来转发git协议?
发布评论