Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to do git remotes on my local network using avahi:

git clone ssh://josh@west.local:test.git

Git is complaining:

ssh: Could not resolve hostname west.local:: Name or service not known

Yet I can ssh to west.local without problems. And regular lookups succeed:

$ host west.local
west.local has address
Host west.local not found: 3(NXDOMAIN)

In case it matters, I'm running Ubuntu 10.04, and west.local is an OS X machine using Bonjour.

How can I get git to talk to west.local, short of hard-coding something in /etc/resolv.conf (which ruins the point of zeroconf)?

share|improve this question
up vote 3 down vote accepted

This looks like an URL syntax issue. If you want to use a repository path relative to the home directory on the remote machine, use one of the following forms:

git clone ssh://josh@west.local/~/test.git
git clone josh@west.local:test.git

Mixing them and using ‘:’ after the host name in the full ssh:// form does not work.

share|improve this answer
Gaaaah. I'm an idiot! Yes, that works wonders. Sigh. Thanks. :) – Josh Bleecher Snyder Dec 13 '10 at 15:26

I have no hands-on experience with zeroconf. How about creating an alias?

alias gitclone="git clone ssh://josh@$(host west.local | awk {'print $NF'}):test.git"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.