git clone over ssh error 'fatal: The remote end hung up unexpectedly'

12,664

Solution 1

Can you verify that that A) you indeed can ssh into the server, and B) that the repository is exactly at the path specified?

You can do ssh username@host ls /home/shared/g_quoll/repos/ and see if there is a itko-ext.git directory there.

Solution 2

Try:

git clone username@host:/home/shared/g_quoll/repos/itko-ext
Share:
12,664

Related videos on Youtube

Eugene Yu
Author by

Eugene Yu

(your about me is currently blank)

Updated on September 16, 2022

Comments

  • Eugene Yu
    Eugene Yu over 1 year

    I'm pretty new to using git and have been struggling to get it work for the last 2 days and now I feel so stupid that I still haven't got it working yet.

    I've seen many posts talking about the similar error but none of the answers solved my problem.

    my situation here is

    1. project git called itko-ext.git is stored in a server and I have an access via ssh

    2. So I create a repositary directory on my local storage and used git init

    3. To copy the itko-ext.git into my repositary, I used git clone ssh://username@host/home/shared/g_quoll/repos/itko-ext.git

      • and this gives me an error fatal: The remote end hung up unexpectedly.
      • I have access to the resource.

    I will appreciate any solution.

    Regards

    • Owen
      Owen
      Does your server use the default port 22 for ssh?
  • Eugene Yu
    Eugene Yu over 11 years
    unfortunately it says the path does not exist
  • Michael
    Michael over 11 years
    Err, sorry. I assumed you had provided the correct directory on the remote server. Is the folder on the remote server /home/shared/g_quoll/repos/itko-ext?
  • Eugene Yu
    Eugene Yu over 11 years
    Yes I can ssh into the server, and the path is correct... :( I talked to another colleague and he said it could be because of the size of the folder cuz it's almost 1gb..
  • Eugene Yu
    Eugene Yu over 11 years
    yes, that's the path to the git folder. umm but I'm starting to think that I misunderstood the concept of cloning. Is cloning should be done on the server side? or client side? cuz I've been only trying on client side...
  • pcm
    pcm over 11 years
    Can you scp the directory to your client using the specified username? IOW scp -r username@host:/home/shared/g_quoll/repos/itko-ext.git. Or more generally, try transferring any file from the server using the username. I'm wondering if your ssh keys are set up correctly.
  • pcm
    pcm over 11 years
    Sorry, to make the example clearer: scp -r username@host:/home/shared/g_quoll/repos/itko-ext.git/ /tmp
  • Mark Leighton Fisher
    Mark Leighton Fisher over 11 years
    Cloning is done where you want the clone (the client side in a client-server model, which Git is not).
  • Eugene Yu
    Eugene Yu over 11 years
    Unfortunately scp didn't work. but what I did was clone the git into a new folder on where the original git is stored then copy the folder into my local computer. I appreciate all of you people. Thanks
  • pcm
    pcm over 11 years
    If scp didn't work, but you can ssh into the server, then it sounds like either the path is wrong, or there is some permissions issue on the target folder. If you cannot ssh to the server, then you need to work on that aspect. You can use -vvv to get lots of output on what is going on. If you ended up just copying the directory, then you'll have the repository, but still won't be set up to take advantage of the get push/pull capabilites to keep your copy in sync with the remote end.
  • Eugene Yu
    Eugene Yu over 11 years
    Sorry for coming back late. Anwy the problem was that I had a week VPN connection in to the network where server is located. It went all good when I tried in in the network directly.