【问题标题】:Git push error: ssh: Could not resolve hostname domain.com[:7555]: nodename nor servname provided, or not knownGit推送错误:ssh:无法解析主机名domain.com [:7555]:提供节点名或服务名,或未知
【发布时间】:2011-04-30 18:56:01
【问题描述】:

我似乎无法使用 Git 推送到服务器。但是,我可以通过 SSH 连接到盒子。
我不知道为什么:

$ cat .git/config   
[core]  
    repositoryformatversion = 0  
    filemode = true
    bare = false  
    logallrefupdates = true  
    ignorecase = true  
[remote "server_idm"]  
    url = ssh://username@domain.com[:7555]/home/username/repo_Project/  
    fetch = +refs/heads/*:refs/remotes/server_idm/*  

$ git push server_idm

ssh: Could not resolve hostname domain.com[:7555]: nodename nor servname provided, or not known fatal:  
The remote end hung up unexpectedly  

但是,我可以轻松地通过 SSH 连接到盒子。
$ ssh -p 7555 用户名@domain.com

Linux servername 2.6.32.9-rscloud #6 SMP Thu Mar 11 14:32:05 UTC 2010 x86_64 GNU/Linux  
Ubuntu 10.04 LTS  

Welcome to Ubuntu!  

Last login: Mon Oct 25 21:22:44 2010 from 8.17.58.38  
username@servername Tue Oct 26 14:01:59 ~   
$ exit  
logout  
Connection to domain.com closed.  

【问题讨论】:

    标签: git ssh git-push


    【解决方案1】:

    尝试删除 URL 中的方括号。

    【讨论】:

    • 在文档中 [] 通常表示“这个位是可选的”
    猜你喜欢
    • 2014-01-05
    • 2013-12-13
    • 1970-01-01
    • 2015-04-22
    • 2013-08-10
    • 2017-04-18
    • 2020-08-21
    • 2019-01-05
    • 2019-12-18
    相关资源
    最近更新 更多