Question:
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:
1 2 3 4 |
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' |
My local git config is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 |
[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.)
What is wrong with my git configuration?
Answer:
If you put something like this in your .ssh/config
:
1 2 3 4 5 |
Host githost HostName git.host.de Port 4019 User root |
then you should be able to use the basic syntax:
1 2 |
git push githost:/var/cache/git/project.git master |