Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git credential helper causes "repository not found" error?

Tags:

git

Just ran into this Git behavior which looks like a bug with credential-store:

$ git pull Username for 'https://github.com': ... Password for 'https://[email protected]': ... Already up-to-date. $ git config credential.helper store $ git pull remote: Repository not found.

Then, go and edit .git/config to remove [credential] helper = store and git pull works again.

What could cause it?

How do I use credential helper without running into this error?

UPDATE Using git version 1.9.1 on Ubuntu 14.04

UPDATE Retested with git version 2.9.3, same result.

UPDATE I have several accounts on github in ~/.git-credentials. I ran git with GIT_CURL_VERBOSE=1 GIT_TRACE=1 and it looks like it picks the first github account in the order they're listed.

However .git/config in the repo I'm working in has the correct user.email, which does have a matching entry in ~/.git-credentials. It just doesn't use that entry.

like image 721
Alex I Avatar asked Aug 31 '16 01:08

Alex I


People also ask

Why is GitHub repository not found?

Error: Repository not found. If you see this error when cloning a repository, it means that the repository does not exist or you do not have permission to access it.

How do I turn off credential helper in Git?

Since the credential. helper key is a multi-valued config list, there's no way to "unset" a helper once it's been set. So if your system /etc/gitconfig sets one, you can never avoid running it, but only add your own helpers on top. Since an empty value for credential.

What is credential helper in Git?

Credential helpers are programs executed by Git to fetch or save credentials from and to long-term storage (where "long-term" is simply longer than a single Git process; e.g., credentials may be stored in-memory for a few minutes, or indefinitely on disk).


1 Answers

What worked for me was in .git folder I opened the config file.

Now you need to insert:

[credential "https://github.com/yourProjectPath"]

username = yourGithubUsername

After this you can use:

git config credential.helper store

This will add this to the config file:

[credendial]
helper = store

Make sure the config file has this section at the end and does not have a duplicate of it before the "credential" section you added previously

Then run:

git pull

And fill in your password.

like image 60
ThomasCarlsen Avatar answered Oct 02 '22 18:10

ThomasCarlsen