D0vev D0vev - 1 year ago 81
Git Question

Git suddenly cant find Github repository

I have got a Github organisation managed by my github account. All my repositories have been working well. When I create a new repository I set it as private and add my Github account as Collaborator. Suddenly all my repositories on all computers stopped "working". Everytime I want to pull or push a repository i get this error:

enter code hereremote: Repository not found.
fatal: repository 'https://github.com/Organisation/Repository.git/' not found

It is the same with all repositories and clients I am working with. Even with newly created private repos.

My workflow when creating a new repo is

  1. Add the repo on Github Website and set it as private

  2. Add my Github Account as Collaborator

  3. On terminal switch into my repo folder.

  4. git init

  5. git remote add origin https://CopiedLinkToPrivateRepo

  6. git add .

  7. git commit -m 'my message'

  8. git push origin master

  9. Dang - repository not found

That workflow has worked for years now. Until a few weeks ago when it suddenly stopped working.

Answer Source

Thanks to CodeWizard.

For all searching people, there seem to be two solutions.

  1. Use SSH Keys to provide the credentials. Otherwise the private repositories can not be found. For any reason Git does not ask for credentials anymore without ssh keys.
  2. The secound way is to set your username into your remote url. As example: git remote set-url https://USERNAME@github.com/usernameOrOrganisation/repository.git. The Github website sometimes does not seem to provide the links with the username in it.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download