1

I'm using a few different git accounts for public and private repositories.

Not I'm trying to clone a private repository, but

git clone https://git.... .git

returns an error:

remote: Repository not found.

But my URL is good enough (with saved case). I've just copied this from github.

I expected to enter my git username and password for a user who has enough of permissions for this private repository.

I've tried also:

ssh -T git@github.com

This returns:

Hi <username_without_access_to_expected_repo>! You've successfully authenticated, but GitHub does not provide shell access.

I was also trying to set current SSH key from my machine to private repository, but it told me that this key is already using.

So, is it possible to clone my private repository with the expected user?

I was looking for something like:

git login

But this command doesn't exist.

P.S. I've set my

git config --global user.name
git config --global user.email

for a user with expected username and email who has enough of permissions.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
smart
  • 1,975
  • 5
  • 26
  • 46

3 Answers3

2

Regarding your https issue (repo not found), check the value of git config credential.helper.
If you see "manager" or "osxkeychain", that means your credentials (GitHub username/password) are cached.
You need to remove/update them first, before trying your git clone again.
Remove or update them on Windows or on Mac.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

you are trying to clone from https. but after you test connection with ssh. possibly you put your ssh key to both public and private repos. try remove ssh key from private repo and try again.

serdroid
  • 166
  • 2
  • 7
0

As a temporary fix I've used the following command:

git clone https://<username>:password@git....
smart
  • 1,975
  • 5
  • 26
  • 46