-1

I'm trying to use git from eclipse. I'm using Eclipse Kepler and Egit 3.0.

All local commands work fine, but I can't connect to the repo.

For example, fetch fails with java.net.UnknownHostException: my-server.

The .git for the project is configured so that the origin is set to ssh://my-server/my-project.git

The command git fetch origin works fine from outside eclipse.

my-server is an alias that is not set in the DNS, just in the ssh configuration (it is not accessible from the OS, but it is from the ssh client).

In window->preferences->ssh2, the ssh2 home is set to the .ssh folder of the machine (the one used by the ssh client that accesses origin just fine).

It would seem that the ssh configuration is not accessed properly. Any idea what's wrong, or how I could debug this (for example, the logs of the ssh connection attempt) ?

gravetii
  • 9,273
  • 9
  • 56
  • 75
Simon4815
  • 19
  • 4

1 Answers1

0

UnknownHostException indicates a DNS failure or some kind. Sounds like "it is not accessible from the OS, but it is from the ssh client" applies only to the command line ssh client. Eclipse uses Java library implementations of ssh2 and git, not the command line clients.

Basically, stop using aliases.

nitind
  • 19,089
  • 4
  • 34
  • 43
  • Yes this seems to be the problem, but I wouldn't want to break all my configuration and create a specific one just for eclipse. What I don't understand is why it's not working, as they should share the same configuration (git does, because I can execute local commands, but ssh probably doesn't, although I set up the ssh2 home of eclipse to the .ssh folder of the machine. – Simon4815 Jun 17 '14 at 08:22