views:

140

answers:

3

I am the CM person for a small company that just started using Git. We have two Git repositories currently hosted on a Windows box that is our all-purpose Windows server. But, we just set up a dedicated server for our CM software on an Ubuntu Linux server named "Callisto".

So I created a test Git repository on Callisto. I gave its directory all of the proper permissions recursively. I had the sysadmin create a login for me on Callisto, and I created a key to use for logging in via SSH. I set up my key to use a passphrase; I don't know if that could be contributing to my problems? Anyway, I know my SSH login works because I tested it through puTTY.

But, even after hours of trials and head scratching, I can't get my Windows Git bash (mSysGit) to talk to Callisto for the purposes of pushing or pulling Callisto's git repository files.

I keep getting "Fatal error. The remote end hung up unexpectedly." And I've even gotten the error that Git doesn't recognize the test repository on Callisto as a git repository. I read online that the "Fatal error...hung up unexpectedly" is usually a problem with the server connection or permissions. So what am I missing or overlooking here? And why doesn't a pull using the git:// protocol work, since that only uses read-only access? Group and public permissions for the git repository's directory on Callisto are set to read and execute, but not write.

If anyone could help, I would be so grateful. Thank you.

A: 

I have only passing familiarity with mSysGit, but I don't think it installs an ssh client. Without the ssh client, git cannot connect to the server. (This functionality isn't baked into git as per the Unix philosophy.) As for the git protocol, unless the server has that enabled, it won't work. Since it seems you have the server setup for ssh access, I doubt you'll get anywhere with the git protocol.

jcordasc
msysgit installs ssh or - if you have - uses pageant.
Vili
A: 

Anyway, I know my SSH login works because I tested it through puTTY.

Have you confirmed that you can SSH to the server from your msysgit client?
i.e. what happens when you ssh [email protected] from the msysgit command line?

For further details about setting up your git server, you may want to review Pro Git: Chapter 4 "Git on the Server".

And why doesn't a pull using the git:// protocol work, since that only uses read-only access?

For the git protocol to work, you must setup the git daemon on your server as described in Chapter 4.9 of Pro Git.

You may also want to take a look at this answer to a related SO question. It has a more detailed checklist of things to consider.

Tim Henigan
+1  A: 

If you use putty/pageant, check if your host is in the know_hosts file in

docssettings/userdir/.ssh

If not, try putty first and accept the key your server provides.

Do you have similar lines in .git/config?

[remote "origin"]
url = ssh://user@server/.../repo.git 
Vili