Unable to access git reponsitory

When I am trying to clone or commit to my git reponsitory
git clone –branch 7.x-1.x [username]:sandbox/[username]/2545940.git

I was getting below errors.

Unable to negotiate with no matching key exchange method found.
Their offer: diffie-hellman-group1-sha1
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

Tip for others: For temporarily circumventing this, you can just use this shell command before doing any fetches/pushes:

$ export GIT_SSH_COMMAND='ssh -o KexAlgorithms=+diffie-hellman-group1-sha1'

This will allow the insecure key exchange algorithm just for Git, and just in the current shell.