Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with cloning git repository

Tags:

git

ssh

I am trying to clone the git repository and i am getting error

Unable to negotiate with <server>: no matching key exchange method found.
Their offer: diffie-hellman-group1-sha1
fatal: Could not read from remote repository.

I edited ~/.ssh/config and added

Host somehost.example.org
KexAlgorithms +diffie-hellman-group1-sha1"

but still I am getting same error.

Other solution is to use the command ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 [email protected] -p 2222 but I am getting connection refused with port no 22 as well.

I am using windows machine.

like image 747
debonair Avatar asked Nov 25 '15 07:11

debonair


People also ask

Why my git clone is not working?

If you have a problem cloning a repository, or using it once it has been created, check the following: Ensure that the user has gone through initial GitCentric login and has the correct username, email, and ssh. This should return a usage message that refers to the config-branch, config-repo, and ls-repo commands.

Is it safe to clone git repository?

There are quite many configuration and log files that are local to a repository. But there is no danger in copying them directly, for example when restoring backups or moving the repository to another directory/harddrive/machine.

What would happen if you cloned an existing git repository?

When you clone a repository, you copy the repository from GitHub.com to your local machine. Cloning a repository pulls down a full copy of all the repository data that GitHub.com has at that point in time, including all versions of every file and folder for the project.


2 Answers

touch ~/.ssh/config

attach my ssh config for people who come across the same issue

## use kex algorithm ##
Host 10.172.4.66
    KexAlgorithms diffie-hellman-group1-sha1

## Avoid Write failed : boken pipe issue ##
ServerAliveInterval 120
TCPKeepAlive no

use larger postBuffer if come accross another issue

fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
$ git config --global http.postBuffer 10000000000000000000000000000000

$ git clone ssh://xxx xx
Cloning into 'xx'...
remote: Counting objects: 105491, done.
remote: Compressing objects: 100% (32876/32876), done.
Receiving objects: 100% (105491/105491), 1.74 GiB | 19.55 MiB/s, done.
remote: Total 105491 (delta 67211), reused 104583 (delta 66603)
Resolving deltas: 100% (67211/67211), done.
Checking connectivity... done.
Checking out files: 100% (16545/16545), done.
like image 195
suiwenfeng Avatar answered Sep 22 '22 19:09

suiwenfeng


Appending the file C:\Program Files\Git\etc\ssh\ssh_config with below content worked for me:

KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group14-sha1

like image 21
Mayur Chavan Avatar answered Sep 22 '22 19:09

Mayur Chavan