Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 208.68.139.38
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
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.