Dilini
Dilini

Reputation: 91

Can not clone from remote GIT repository using cmd under normal user account

I have open the cmd and just run the following command.

D:\x>git clone ssh://username@host/path/to/git/repositories/xModule.git

Then I got the following error….

"Cloning into xModule '...
fatal: Could not read from remote repository.
Please make sure you have the correct access rights 
and the repository exists."

But if I run the cmd as administrator then the above command is working finely and would be able to check out the project.
Seems to me there is permission issue with my normal user account.
Please can someone explain, what is the exact reason behind this?

Upvotes: 1

Views: 543

Answers (2)

Dilini
Dilini

Reputation: 91

I found the solution and it was worked correctly for my case.

GO Start ---> user accounts ---> change my environment variable -----> user variable section.

once you located to "user variable section" there are two user environment variables ,called "SVN_SSH" and "GIT_SSH". Please delete these two and log off and log in to the machine again.

Now open the cmd and run above git command.This should be worked seamlessly.

Upvotes: 1

VonC
VonC

Reputation: 1323803

But if I run the cmd as administrator then the above command is working finely and would be able to check out the project

That should mean ssh is able to find the right public/private keys in %HOME%/.ssh/id_rsa(.pub).

  • Check what %HOME% looks like when cmd is run as admin, as opposed to cmd run as username.
  • see if a ssh -Tvvv username@host works in a cmd run as admin, and doesn't work in a cmd run as username: that would confirm the key issue.

Upvotes: 0

Related Questions