0

我之前曾在一个项目中Ruby on Rails使用Vagrant作为开发环境。完成项目后,我开始在 中的一个项目中工作Java,但是当我尝试将项目克隆到我的工作区时,我在 Git Bash 控制台上收到此错误:

git clone git@git.address.com:mari/project.git 
Cloning into 'project'

/usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:763:in 'initialize':     No route to host - connect(2) (Errno::EHOSUNREACH)
from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:763:in 'open'

from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:763:in 'block in connect'

from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:55:in 'timeout'

from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:100:in 'timeout'

from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:763:in 'connect'

from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:756:in 'do_start'

from /usr/local/rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:745:in 'start'

from /opt/git/gitlab-shell/lib/gitlab_net.rb:56:in 'get'
from /opt/git/gitlab-shell/lib/gitlab_net.rb:17:in 'allowed?'
from /opt/git/gitlab-shell/lib/gitlab_net.rb:51:in 'validate_access'
from /opt/git/gitlab-shell/lib/gitlab_net.rb:21:in 'exec'
from /opt/git/gitlab-shell/lib/gitlab_net.rb:16:in '<main>'

fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

注意:我已经尝试过这个解决方案(更改远程 Git 存储库的 URI (URL))但没有奏效。知道会发生什么吗?

编辑:我使用的是 Windows,但 Vagrant 上使用的 VM 是 Linux。

4

2 回答 2

1

像这样尝试 git 远程 url

   http://<username>@git.address.com/<path>.git
于 2013-09-11T14:41:11.300 回答
1

尝试将协议添加到远程 url 的开头:

ssh://git@git.address.com/mari/project.git 

也不要使用 a:来分隔路径和 uri,而是使用 a/代替。

当然,您可以使用其他协议作为 ssh。

于 2013-09-11T14:27:10.400 回答