Connect to a git server in port other than 22
未关闭
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 1.7k
- 派生
- 408
- 平均合并
- 2 天 57 分钟
- 30 天内合并 PR
- 7
描述
In git, there are two ways to connect/clone a remote repository:
git clone git@git-in-port-22.com:libgit2/pygit2.git
git clone ssh://git@git-in-another-port.com:2345/libgit2/pygit2.git
and the 2nd one support to connect to a remote git server which is not in port 22.
In pygit2 doc, the connection is through
pygit2.clone_repository("ssh://git@github.com/libgit2/pygit2", "pygit2.git",
callbacks=callbacks)
After confirmed git clone ssh://git@localhost:8822/home/git/server.git can succeed, I tried
pygit2.clone_repository("ssh://git@localhost:8822/home/git/", "server.git")
but
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pygit2/__init__.py", line 263, in clone_repository
check_error(err)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pygit2/errors.py", line 64, in check_error
raise GitError(message)
_pygit2.GitError: unsupported URL protocol
I wonder if there's a way to specify a customized port?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 pygit2.clone_repository 入口点开始,复现报告中的 ssh://localhost:8822 克隆命令。跟踪 URL 的解析过程以及它如何传递给 SSH 传输,然后验证从非 22 端口进行克隆时不会出现不支持的 URL 协议错误,并且能够成功完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, python
- 领域
- tooling
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100