如何仅使用 gitorious.org 的默认 git 端口
假设我可以 telnet 到 gitorious.org 端口 9418(git 的默认端口),但不能通过 SSH 端口。如何设置 gitorious 以便当我尝试推送时不会发生这种情况:
git push
ssh: connect to host gitorious.org port 22: Connection timed out
fatal: The remote end hung up unexpectedly
所以我只想使用端口 9418。这可能吗?如何做到这一点?
Assuming I can telnet to gitorious.org port 9418 (default for git), but not on SSH port. How to set up gitorious so that when I try to push, this wouldn't happen:
git push
ssh: connect to host gitorious.org port 22: Connection timed out
fatal: The remote end hung up unexpectedly
So I want to use ONLY port 9418. Is that possible and how to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
端口 9418 是 git 协议的默认端口,该端口未经身份验证、未加密,因此是只读的。除非 gitorious 正在做一些奇怪的事情(我对此表示怀疑),否则您在该端口上所能做的就是读取(获取/拉取)。
如果 SSH 被阻止,主要的解决方法是使用 HTTPS - 你能用这种方式推送吗?
Port 9418 is the default port for the git protocol, which is unauthenticated, unencrypted, and therefore meant to be read-only. Unless gitorious is doing something weird (I doubt it), all you can do on that port is read (fetch/pull).
The primary workaround if SSH is blocked is to use HTTPS - can you push that way?
.git/config
有一个[remote "origin"] -> url
可以遵循以下模式之一:根据您提供的错误,您的指向
ssh://
。如果您想推送 9418,并且 gitorious 支持它(git:// 协议的默认端口),您将需要源点指向该端口。The
.git/config
has an[remote "origin"] -> url
that can follow one of the following patterns:Based on the error you're providing, it looks like your's points to
ssh://
. If you want to push through 9418, and if gitorious supports it, (git:// protocol's default port), you'll need the origin to point to that.