我在一个Stash服务器上运行了一个git仓库。通过http
克隆该仓库是可以正常工作的。
git clone http://user@server:7990/a/b/sandbox.git
因为某种奇怪的原因,当我把http
替换成ssh
并且同时更改端口时,它会给我返回
git clone ssh://user@server:7999/a/b/sandbox.git
Cloning into sandbox...
fatal: remote error: Remote URL invalid
A repository could not be determined from the remote URL. Please confirm the
clone URL in Stash and try again. URL suffix: '/scm/ct/sandbox.git'
fatal: The remote end hung up unexpectedly
服务器开启了ssh
并将端口设置为7999
。为什么当通过ssh
发送请求而不是http
时,它找不到存储库呢?
~/.ssh/config
来适当配置SSH,并且只需使用git clone server:path/to/repo.git
)。 - AD7sixuser@server:7990/a/b/sandbox.git
,而ssh-url则是user@server:7999/b/sandbox.git
(其中a
和b
当然是占位符)。 - Vinceprojects/_project_/repos/_reponame_
。 对于SSH而言,它必须是文件系统中的常规目录路径。例如,/dev/scm/_reponame_
。 - Aelian