我正在为远程存储库设置本地git项目。远程存储库正在非标准端口上提供(4019)。
但这是行不通的。相反,我收到以下错误消息:
ssh: connect to host git.host.de:4019 port 22: Connection refused
fatal: The remote end hung up unexpectedly
error: failed to push to 'ssh://root@git.host.de:4019/var/cache/git/project.git'
我的本地git配置如下:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = ssh://root@git.host.de:4019/var/cache/git/project.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
(端口和主机是实际端口和主机的占位符。)
我的git配置有什么问题?
@Kzqai的评论很重要。即,如果您这样做
—
橡树
git remote set-url origin git@altssh.bitbucket.org:443/yourname/yourrepo/将无法正常工作。但是,如果您这样做,git remote set-url origin ssh://git@altssh.bitbucket.org:443/yourname/yourrepo/将起作用
对于Google Fu,当我将phabricator设置为2222的非默认端口时,我遇到了这个问题。
—
user3791372
ssh://url之前,它会认为这是一种不同的格式。所以ssh://example.com:444/etc/是/ etc / example.com上通过端口44而example.com:444/etc/是/ 444的/ etc / example.com上经由端口22