How to troubleshoot “remote end hung up unexpectedly” error in Git

Posted on

QUESTION :

I setup GIT in a Windows and a Ubuntu. Both of them works well locally. Now I want to put some repository from Windows to Ubuntu. I think I can use ‘git push’ in the Windows, or use ‘git clone’ in the Ubuntu. But neither works.

When I use

git push -v xxx.xxx.xxx.xxx:/share/source/repo.git

At begining, I got an error:

The server’s host key is not cached in the registry. You have no guarantee that the server is the computer you think it is.

After I used putty to save the host key, the error message disappeared. Then I got a

does not appear to be a git repository

error. After I modified the path to repository, the error message disappeared too. Now I get:

fatal: The remote end hung up unexpectedly

I didn’t get enough information from the message.

So I want to check the git’s log in both Windows and Ubuntu side to check what happened. But after googling ‘git log’, all entries are about git commit history. that’s not what I need.

Can anyone shred me some light on this?

ANSWER :

Using a remote URL of the form [address]:/path/to/repo.git implies you are using SSH to connect. However, you haven’t supplied a username. I’m not sure how Git behaves in this situation, but it makes me think you might not have write-access.

Perhaps try using a URL of the following form to specify the username with which to connect to Ubuntu:

[user]@[address]:/path/to/repo.git

Perhaps try cloning from that repository to see if you even have read access. Go into a new empty folder and run one of:

git clone [address]:/path/to/repo.git .
git clone [user]@[address]:/path/to/repo.git .

If you can clone the remote repository, then you know you have read access

Leave a Reply

Your email address will not be published.