使用具有非标准端口的远程存储库 [英] Using a remote repository with non-standard port
本文介绍了使用具有非标准端口的远程存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为远程存储库设置我的本地git项目。远程仓库正在非标准端口上提供(4019)。
I am setting up my local git project for a remote repository. The remote repository is being served on a non-standard port (4019).
但它不起作用。相反,我收到以下错误消息:
But it doesn't work. Instead I get the following error message:
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配置是,如下所示:
My local git config is as follows:
[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
(端口和主机是实际端口和主机的占位符。)
(The port and host are placeholders for the actual port and host.)
我的git配置有什么问题?
What is wrong with my git configuration?
推荐答案
这在你的 .ssh / config
:
Host githost
HostName git.host.de
Port 4019
User root
然后你应该能够使用基本的语法:
then you should be able to use the basic syntax:
git push githost:/var/cache/git/project.git master
这篇关于使用具有非标准端口的远程存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文