Joy Li
Joy Li

Reputation: 139

Git clone remote: Repository not found

I forked a private repo on github and tried to clone a copy on my computer but it said :

remote: Repository not found.

Does it mean I don't have permission to this repo? When I clicked on the collaborator button it says I have the option to leave the repo so I guess I have the permission.

What's wrong?

Upvotes: 2

Views: 6810

Answers (3)

Jos_BCN
Jos_BCN

Reputation: 81

My problem: I created a new Github account and used the character '@' in my password. While Github dosen't have an issue, but Git interpreats '@' as the end instruccion. As a result, the repository name "not found".

Upvotes: 0

Yura
Yura

Reputation: 3235

I had the same problem with my private repo (Repository not found) due to the fact that initially I logged in with an incorrect githab account. To fix it:

  1. Open Control Panel from the Start menu
  2. Select User Accounts
  3. Select "Manage your credentials" in the left hand menu
  4. Delete any credentials related to Git or GitHub

Upvotes: 2

Jaken
Jaken

Reputation: 1343

Without seeing your specific instruction, it's hard to say what's wrong. But running these commands should work if you have permissions:

$ git clone https://github.com/username/repository

Obviously, replace "username" and "repository" with their respective names. Also, to add your remote:

$ git remote add origin https://github.com/username/repository

origin can be named whatever you'd like it to be, though. I like to use my repository names rather than origin. So if I had a repository named "StackOverflow", I would say:

$ git remote add StackOverflow https://github.com/username/StackOverflow

Then to initialize, add code, commit code, and push:

$git init
$git add .
$git commit -m 'commit message'
$git push StackOverflow master

Hope this helped a bit.

Upvotes: -1

Related Questions