3

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)?

2 Answers2

3

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.

Sergey Vlasov
  • 6,288
  • 1
  • 21
  • 30
0

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"

weeheavy
  • 4,089
  • 1
  • 28
  • 41