【发布时间】:2023-03-30 16:39:01
【问题描述】:
1) 我在我的 Windows 开发机器上设置了一个本地 git 存储库。
2) 使用 hostgator 在我的云主机帐户上创建了一个远程仓库
3) 在本地机器上生成 SSH 密钥。
4) 为 hostgator 添加了密钥
5) 我可以通过 ssh 连接到我的服务器上的 2222 端口而无需通过。所以现在我的本地和远程存储库已成功链接。
当我尝试将远程 repo(在 hostgator 上)添加到 SourceTree 时,问题发生了。
Sourcetree 不会加载 SSH 密钥,除非它们是 ppk 格式(我的密钥不是) 所以我使用 Putty 生成了新的密钥对,并将它们添加到 hostgator 和 sourcetree SSH 代理。
现在我不确定我是否将远程 repo 的正确地址输入到 SourceTree 中
我尝试了什么:
ssh://<username>@mywebsite.com:2222/path/to/my/remote/repo.git
and
<username>@mywebsite.com:2222/path/to/my/remote/repo.git
我不确定问题是由错误的地址还是新的 ssh 密钥引起的。
当我尝试从 SourceTree 上的远程仓库获取时,我得到:
git -c diff.mnemonicprefix=false -c core.quotepath=false fetch <name of repo>
FATAL ERROR: Server unexpectedly closed network connection
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Completed with errors, see above.
我的问题是:
1) 我生成新的 ppk 密钥并链接它们的步骤是否错误?
2) 我应该与 SourceTree 一起使用的 url/路径是什么?
我被困住了:(
【问题讨论】:
-
您的 SourceTree 是否支持 PPK 密钥?
-
是的,它只支持用putty生成或用putty转换的key。
标签: git ssh version-control atlassian-sourcetree