ฉันกำลังตั้งค่าโปรเจ็กต์ 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'
การกำหนดค่าคอมไพล์ในเครื่องของฉันมีดังนี้ :
[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 remote set-url origin git@altssh.bitbucket.org:443/yourname/yourrepo/มันเคยชิน แต่ถ้าคุณทำเช่นgit remote set-url origin ssh://git@altssh.bitbucket.org:443/yourname/yourrepo/นี้จะได้ผล
ssh://หน้า url อย่างชัดเจนมันจะคิดว่าเป็นรูปแบบอื่น ดังนั้นssh://example.com:444/etc/คือ / etc / บน example.com ผ่านพอร์ต 44 ในขณะที่example.com:444/etc// 444 / etc / บน example.com ผ่านพอร์ต 22