0

I previously worked on a project in Ruby on Rails using Vagrant as development environment. After I finished the project, I started to work in a project in Java, but when i try to clone the project into my workspace, i'm getting this error on Git Bash console:

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.

NOTE: I've tried this solution (Change the URI (URL) for a remote Git repository) and didn't work. Any idea what might be happening?

EDIT: I'm using Windows, but the VM used on Vagrant is Linux.

Community
  • 1
  • 1
mari
  • 864
  • 3
  • 12
  • 32
  • 1
    does `git@git.address.com:mari/project.git` denote a valid git repository? Does `git.address.com` resolve to a valid host? The error returned would indicate that git cannot resolve the hostname of the server on which your repository resides. – mcfinnigan Sep 11 '13 at 14:21
  • Yes @mcfinnigan, the repo is registered on my known_hosts file, 'cause i've clone other projects from there before this – mari Sep 11 '13 at 14:26

2 Answers2

1

Try adding the protocol to the beginning of the remote url:

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

Also don't use a : to seperate path and uri, but use a / instead.

Of course, you can use another protocol as ssh.

functionpointer
  • 1,411
  • 1
  • 13
  • 18
  • Is the path `/mari/project.git` actually corrent? Maybe it is something like `/home/mari/project.git`? – functionpointer Sep 11 '13 at 14:37
  • No, the path is correct, is the link of the project on GitLab. – mari Sep 11 '13 at 19:09
  • Well, git says 'no route to host', so this is a connection problem. Make sure that the url is correct and that you have network access. Also make sure that the remote server is online. I dont think this is a permission problem, as git's error message would be 'blabla does not appear to be a git repository' in that case. – functionpointer Sep 11 '13 at 20:20
  • Server is ok, ssh keys too, so, by facing this bizarre situation, I solved by creating a new repository from a project backup. Thanks for the suggestions! – mari Sep 11 '13 at 21:22
1

try git remote url like this

   http://<username>@git.address.com/<path>.git
kiruba
  • 336
  • 1
  • 11